github actions: update all actions
This commit is contained in:
+30
-12
@@ -1,6 +1,10 @@
|
|||||||
name: Check PR health
|
name: Linting Check
|
||||||
|
|
||||||
on: [pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-lint:
|
check-lint:
|
||||||
@@ -8,15 +12,29 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Node
|
- name: Setup Node and Corepack
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 20.x
|
||||||
|
|
||||||
- name: Install packages
|
- name: Enable Corepack and Set Yarn Version
|
||||||
run: yarn
|
run: |
|
||||||
|
corepack enable
|
||||||
- name: Check linting
|
corepack prepare yarn@4.x --activate
|
||||||
run: yarn lint
|
|
||||||
|
- name: Restore Yarn Cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
id: yarn-cache
|
||||||
|
with:
|
||||||
|
path: .yarn/cache
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
run: yarn install --immutable
|
||||||
|
|
||||||
|
- name: Check linting
|
||||||
|
run: yarn lint
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
increment:
|
increment:
|
||||||
type: string
|
type: string
|
||||||
description: "Must be: patch, minor, major, pre* or <version>"
|
description: 'Must be: patch, minor, major, pre* or <version>'
|
||||||
required: true
|
required: true
|
||||||
default: "patch"
|
default: 'patch'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
manual-release:
|
manual-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -27,20 +28,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 20.x
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Enable Corepack and Set Yarn Version
|
||||||
id: yarn-cache-dir-path
|
run: |
|
||||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
corepack enable
|
||||||
|
corepack prepare yarn@4.x --activate
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- name: Restore Yarn Cache
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
uses: actions/cache@v3
|
||||||
|
id: yarn-cache
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: .yarn/cache
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: yarn
|
run: yarn install --immutable
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
run: "npx release-it --increment ${{ github.event.inputs.increment }}"
|
run: npx release-it --increment ${{ github.event.inputs.increment }}
|
||||||
|
|||||||
@@ -1,38 +1,53 @@
|
|||||||
name: PR Comment
|
name: PR Comment
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- unlocked
|
- unlocked
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pr-comment:
|
pr-comment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: mshick/add-pr-comment@v2
|
- uses: mshick/add-pr-comment@v2
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.PERSONAL_TOKEN}}
|
repo-token: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
message-id: pr-test
|
message-id: pr-test
|
||||||
message: |
|
message: |
|
||||||
Thanks for your contribution.
|
Thanks for opening this pull request and contributing to the project!
|
||||||
|
|
||||||
The next step is to wait for review and approval to merge it to main repository
|
The next step is for the maintainers to review your changes. If everything looks good, it will be approved and merged into the main branch.
|
||||||
|
|
||||||
The community can help reacting with a thumb up (:thumbsup:) for approval and rocket (:rocket:) for who has tested it.
|
In the meantime, anyone in the community is encouraged to test this pull request and provide feedback.
|
||||||
|
|
||||||
To test this PR you can run the following command below:
|
### ✅ How to confirm it works
|
||||||
```
|
|
||||||
# NPM
|
If you’ve tested this PR, please comment below with:
|
||||||
npm install @whiskeysockets/baileys@${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}
|
|
||||||
# YARN v2
|
```
|
||||||
yarn add @whiskeysockets/baileys@${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}
|
Tested and working ✅
|
||||||
# PNPM
|
```
|
||||||
pnpm add @whiskeysockets/baileys@${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}
|
|
||||||
```
|
This helps us speed up the review and merge process.
|
||||||
|
|
||||||
|
### 📦 To test this PR locally:
|
||||||
|
|
||||||
|
```
|
||||||
|
# NPM
|
||||||
|
npm install @whiskeysockets/baileys@${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}
|
||||||
|
|
||||||
|
# Yarn (v2+)
|
||||||
|
yarn add @whiskeysockets/baileys@${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}
|
||||||
|
|
||||||
|
# PNPM
|
||||||
|
pnpm add @whiskeysockets/baileys@${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}
|
||||||
|
```
|
||||||
|
|
||||||
|
If you encounter any issues or have feedback, feel free to comment as well.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ name: Publish Release
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- 'v*'
|
||||||
|
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
|
|
||||||
@@ -23,24 +23,26 @@ jobs:
|
|||||||
uses: actions/setup-node@v3.6.0
|
uses: actions/setup-node@v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 20.x
|
||||||
registry-url: "https://registry.npmjs.org"
|
registry-url: 'https://registry.npmjs.org'
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Enable Corepack and Set Yarn Version
|
||||||
id: yarn-cache-dir-path
|
run: |
|
||||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
corepack enable
|
||||||
|
corepack prepare yarn@4.x --activate
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- name: Restore Yarn Cache
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
uses: actions/cache@v3
|
||||||
|
id: yarn-cache
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: .yarn/cache
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: yarn
|
run: yarn install --immutable
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ jobs:
|
|||||||
run: npm publish --access public
|
run: npm publish --access public
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
- name: Publish in NPM (whiskeysockets scope)
|
- name: Publish in NPM (whiskeysockets scope)
|
||||||
run: |
|
run: |
|
||||||
npx json -I -f package.json -e "this.name='@whiskeysockets/baileys'"
|
npx json -I -f package.json -e "this.name='@whiskeysockets/baileys'"
|
||||||
@@ -66,7 +68,7 @@ jobs:
|
|||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Make Package
|
- name: Make Package
|
||||||
run: npm pack
|
run: yarn pack
|
||||||
|
|
||||||
- name: Rename Pack
|
- name: Rename Pack
|
||||||
run: mv *.tgz baileys.tgz
|
run: mv *.tgz baileys.tgz
|
||||||
|
|||||||
+10
-10
@@ -2,7 +2,7 @@ name: Mark stale issues and pull requests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "30 1 * * *"
|
- cron: '30 1 * * *'
|
||||||
permissions:
|
permissions:
|
||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
@@ -10,12 +10,12 @@ jobs:
|
|||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v3
|
- uses: actions/stale@v3
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
stale-issue-message: 'This issue is stale because it has been open 15 days with no activity. Remove the stale label or comment or this will be closed in 15 days'
|
stale-issue-message: 'This issue is stale because it has been open for 14 days with no activity. Remove the stale label or comment or this will be closed in 14 days.'
|
||||||
stale-pr-message: 'This PR is stale because it has been open 15 days with no activity. Remove the stale label or comment or this will be closed in 15 days'
|
stale-pr-message: 'This PR is stale because it has been open for 14 days with no activity. Remove the stale label or comment or this will be closed in 14 days'
|
||||||
days-before-stale: 15
|
days-before-stale: 14
|
||||||
days-before-close: 30
|
days-before-close: 28
|
||||||
exempt-issue-labels: 'bug,enhancement'
|
exempt-issue-labels: 'bug,enhancement,unstale'
|
||||||
exempt-pr-labels: 'bug,enhancement'
|
exempt-pr-labels: 'bug,enhancement,unstale'
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
name: Update Nightly
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-nightly:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Fetching tags
|
|
||||||
run: git fetch --tags -f || true
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v3.6.0
|
|
||||||
with:
|
|
||||||
node-version: 20.x
|
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: yarn
|
|
||||||
|
|
||||||
- name: Update version to alpha
|
|
||||||
run: yarn version --prerelease --preid=alpha --no-git --no-git-tag-version
|
|
||||||
|
|
||||||
- name: Build NPM package
|
|
||||||
run: yarn pack && mv baileys-*.tgz baileys-nightly.tgz
|
|
||||||
|
|
||||||
- name: Generate Changelog
|
|
||||||
id: generate_changelog
|
|
||||||
run: |
|
|
||||||
changelog=$(yarn run --silent changelog:preview)
|
|
||||||
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
|
||||||
echo "${changelog}" >> $GITHUB_OUTPUT
|
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Update Nightly TAG
|
|
||||||
uses: richardsimko/update-tag@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: nightly
|
|
||||||
|
|
||||||
- name: Update Nightly Release
|
|
||||||
uses: meeDamian/github-release@2.0
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
tag: nightly
|
|
||||||
commitish: ${{ github.sha }}
|
|
||||||
name: Nightly Release
|
|
||||||
body: ${{ steps.generate_changelog.outputs.changelog }}
|
|
||||||
draft: false
|
|
||||||
prerelease: true
|
|
||||||
files: >
|
|
||||||
baileys-nightly.tgz
|
|
||||||
gzip: folders
|
|
||||||
allow_override: true
|
|
||||||
@@ -2,7 +2,7 @@ name: Update WAProto
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "10 1 * * *"
|
- cron: '10 1 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -22,10 +22,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 20.x
|
||||||
|
|
||||||
|
- name: Enable Corepack and Set Yarn Version
|
||||||
|
run: |
|
||||||
|
corepack enable
|
||||||
|
corepack prepare yarn@4.x --activate
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
yarn
|
yarn install --immutable
|
||||||
yarn --pure-lockfile --cwd proto-extract
|
yarn --cwd proto-extract install --immutable
|
||||||
|
|
||||||
- name: Update WAProto.proto
|
- name: Update WAProto.proto
|
||||||
id: wa_proto_info
|
id: wa_proto_info
|
||||||
@@ -48,11 +53,11 @@ jobs:
|
|||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v5
|
uses: peter-evans/create-pull-request@v5
|
||||||
with:
|
with:
|
||||||
commit-message: "chore: updated proto/version to v${{steps.wa_proto_info.outputs.wa_version}}"
|
commit-message: 'chore: updated proto/version to v${{steps.wa_proto_info.outputs.wa_version}}'
|
||||||
title: "Whatsapp v${{steps.wa_proto_info.outputs.wa_version}} proto/version change"
|
title: 'Whatsapp v${{steps.wa_proto_info.outputs.wa_version}} proto/version change'
|
||||||
branch: "update-proto/stable"
|
branch: 'update-proto/stable'
|
||||||
delete-branch: true
|
delete-branch: true
|
||||||
labels: "update-proto"
|
labels: 'update-proto'
|
||||||
body: "Automated changes\nFound source JS URL: ${{steps.wa_proto_info.outputs.wa_js_url}}\nCurrent version: v${{steps.wa_proto_info.outputs.wa_version}}"
|
body: "Automated changes\nFound source JS URL: ${{steps.wa_proto_info.outputs.wa_js_url}}\nCurrent version: v${{steps.wa_proto_info.outputs.wa_version}}"
|
||||||
add-paths: |
|
add-paths: |
|
||||||
WAProto/*
|
WAProto/*
|
||||||
|
|||||||
Reference in New Issue
Block a user