mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
75
.github/workflows/main.yml
vendored
75
.github/workflows/main.yml
vendored
@@ -2,6 +2,21 @@ name: CI
|
|||||||
|
|
||||||
on: ["push"]
|
on: ["push"]
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
# Test:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout Commit
|
||||||
|
# uses: actions/checkout@v2
|
||||||
|
#
|
||||||
|
# - name: Setup Node.js environment
|
||||||
|
# uses: actions/setup-node@v2.1.1
|
||||||
|
#
|
||||||
|
# - name: Install Dependencies
|
||||||
|
# run: npm install
|
||||||
|
#
|
||||||
|
# - name: Run Tests
|
||||||
|
# run: npm run test
|
||||||
Build:
|
Build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
@@ -11,21 +26,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Parsing Package Info
|
- name: Parsing Package Info
|
||||||
id: packageInfo
|
id: packageInfo
|
||||||
|
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=package-name::$(jq -r .name package.json)"
|
||||||
|
echo "::set-output name=package-version::$(jq -r .version package.json)"
|
||||||
|
echo "::set-output name=commit-msg::$(git log -1 --pretty=%B)"
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v2.1.1
|
uses: actions/setup-node@v2.1.1
|
||||||
with:
|
|
||||||
# Set always-auth in npmrc
|
|
||||||
always-auth: false
|
|
||||||
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
|
|
||||||
node-version: 12.x
|
|
||||||
# Set this option if you want the action to check for the latest available version that satisfies the version spec
|
|
||||||
check-latest: true
|
|
||||||
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN
|
|
||||||
registry-url: false
|
|
||||||
# Optional scope for authenticating against scoped registries
|
|
||||||
scope: false
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v2.1.4
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
@@ -33,16 +41,35 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build:all
|
run: npm run build:all
|
||||||
|
|
||||||
|
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v2.1.4
|
||||||
|
with:
|
||||||
|
name: baileysBuilt
|
||||||
|
path: |
|
||||||
|
docs/**/*
|
||||||
|
lib/**/*
|
||||||
|
package.json
|
||||||
|
|
||||||
Publish-Docs:
|
Publish-Docs:
|
||||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: Build
|
needs: Build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Download Build Artifact
|
||||||
|
uses: actions/download-artifact@v2.0.5
|
||||||
|
with:
|
||||||
|
# Artifact name
|
||||||
|
name: baileysBuilt
|
||||||
|
# Destination path
|
||||||
|
path: ${{ github.workspace }}
|
||||||
|
|
||||||
- name: Publish to Pages
|
- name: Publish to Pages
|
||||||
uses: crazy-max/ghaction-github-pages@v2
|
uses: crazy-max/ghaction-github-pages@v2
|
||||||
with:
|
with:
|
||||||
target_branch: gh-pages
|
target_branch: gh-pages
|
||||||
|
if-no-files-found: error
|
||||||
build_dir: docs
|
build_dir: docs
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -52,8 +79,15 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||||
needs: Build
|
needs: Build
|
||||||
steps:
|
steps:
|
||||||
- name: Download the Build Artifact
|
- name: Download Build Artifact
|
||||||
uses: actions/download-artifact@v2.0.5
|
uses: actions/download-artifact@v2.0.5
|
||||||
|
with:
|
||||||
|
name: baileysBuilt
|
||||||
|
path: ${{ github.workspace }}
|
||||||
|
|
||||||
|
- name: Setup Node.js environment
|
||||||
|
uses: actions/setup-node@v2.1.1
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: releaseCreate
|
id: releaseCreate
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -62,11 +96,11 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag
|
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag
|
||||||
tag_name: v${{ steps.packageInfo.outputs.package-version }}
|
tag_name: v${{ needs.Build.outputs.package-version }}
|
||||||
# The name of the release. For example, `Release v1.0.1`
|
# The name of the release. For example, `Release v1.0.1`
|
||||||
release_name: v${{steps.packageInfo.outputs.package-version}}
|
release_name: v${{needs.Build.outputs.package-version}}
|
||||||
# Text describing the contents of the tag.
|
# Text describing the contents of the tag.
|
||||||
body: ${{steps.packageInfo.outputs.commit-msg}}
|
body: ${{needs.Build.outputs.commit-msg}}
|
||||||
# `true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`
|
# `true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`
|
||||||
draft: false
|
draft: false
|
||||||
# `true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`
|
# `true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`
|
||||||
@@ -75,6 +109,9 @@ jobs:
|
|||||||
- name: Pack
|
- name: Pack
|
||||||
run: npm pack
|
run: npm pack
|
||||||
|
|
||||||
|
- name: Rename Pack
|
||||||
|
run: mv *.tgz npmPackage.tgz
|
||||||
|
|
||||||
- name: Upload Package to Release
|
- name: Upload Package to Release
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
@@ -84,8 +121,8 @@ jobs:
|
|||||||
# The URL for uploading assets to the release
|
# The URL for uploading assets to the release
|
||||||
upload_url: ${{steps.releaseCreate.outputs.upload_url}}
|
upload_url: ${{steps.releaseCreate.outputs.upload_url}}
|
||||||
# The path to the asset you want to upload
|
# The path to the asset you want to upload
|
||||||
asset_path: ${{github.workspace}}/${{steps.packageInfo.outputs.package-scope}}-${{steps.packageInfo.outputs.package-name}}-${{steps.packageInfo.outputs.package-version}}.tgz
|
asset_path: npmPackage.tgz
|
||||||
asset_name: NPM-Package-${{steps.packageInfo.outputs.package-name}}-${{steps.packageInfo.outputs.package-version}}.tgz
|
asset_name: npmPackage.tgz
|
||||||
# The content-type of the asset you want to upload. See the supported Media Types here: https://www.iana.org/assignments/media-types/media-types.xhtml for more information
|
# The content-type of the asset you want to upload. See the supported Media Types here: https://www.iana.org/assignments/media-types/media-types.xhtml for more information
|
||||||
asset_content_type: application/x-compressed-tar
|
asset_content_type: application/x-compressed-tar
|
||||||
- name: NPM Publish
|
- name: NPM Publish
|
||||||
|
|||||||
@@ -17,11 +17,12 @@
|
|||||||
"automation"
|
"automation"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run build",
|
|
||||||
"test": "mocha --timeout 60000 -r ts-node/register src/Tests/Tests.*.ts",
|
"test": "mocha --timeout 60000 -r ts-node/register src/Tests/Tests.*.ts",
|
||||||
"lint": "eslint '*/*.ts' --quiet --fix",
|
"lint": "eslint '*/*.ts' --quiet --fix",
|
||||||
"build": "tsc",
|
"build:tsc": "tsc",
|
||||||
"build:docs": "typedoc",
|
"build:docs": "typedoc",
|
||||||
|
"build:all": "npm run build:tsc && npm run build:docs",
|
||||||
|
"build": "",
|
||||||
"example": "npx ts-node Example/example.ts",
|
"example": "npx ts-node Example/example.ts",
|
||||||
"browser-decode": "npx ts-node src/BrowserMessageDecoding.ts"
|
"browser-decode": "npx ts-node src/BrowserMessageDecoding.ts"
|
||||||
},
|
},
|
||||||
@@ -30,6 +31,9 @@
|
|||||||
"repository": {
|
"repository": {
|
||||||
"url": "git@github.com:adiwajshing/baileys.git"
|
"url": "git@github.com:adiwajshing/baileys.git"
|
||||||
},
|
},
|
||||||
|
"files": [
|
||||||
|
"./lib/**/*.js"
|
||||||
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@adiwajshing/keyed-db": "^0.1.1",
|
"@adiwajshing/keyed-db": "^0.1.1",
|
||||||
"curve25519-js": "0.0.4",
|
"curve25519-js": "0.0.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user