Merge pull request #18 from azuya/main #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Nightly | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
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/[email protected] | |
with: | |
node-version: ${{ matrix.node-version}} | |
- 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 install | |
- name: Update version to alpha | |
run: yarn version --prerelease --preid=alpha --no-git --no-git-tag-version | |
- name: Check linting | |
run: yarn run lint | |
- name: Generate Changelog | |
id: generate_changelog | |
run: | | |
changelog=$(npm run changelog:preview --silent) | |
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: Make Package | |
run: npm pack | |
- name: Rename Pack | |
run: mv *.tgz baileys-api-nightly.tgz | |
- name: Update Nightly Release | |
uses: meeDamian/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: nightly | |
name: Nightly Release | |
body: ${{ steps.generate_changelog.outputs.changelog }} | |
draft: false | |
prerelease: true | |
files: > | |
baileys-api-nightly.tgz | |
gzip: folders | |
allow_override: true |