Skip to content

Commit

Permalink
🐛 fix(ci): fixed changelog for workflow release
Browse files Browse the repository at this point in the history
  • Loading branch information
nizarfadlan committed Sep 4, 2024
1 parent adfe131 commit 9e06d47
Showing 1 changed file with 61 additions and 62 deletions.
123 changes: 61 additions & 62 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,79 @@
name: Release

on:
push:
tags:
- "v*"
push:
tags:
- "v*"

permissions: write-all

jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
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: Fetching tags
run: git fetch --tags -f || true

- name: Setup Node
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version}}
- 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
- 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-
- 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: Install Dependencies
run: yarn install

- name: Check linting
run: yarn run lint
- name: Check linting
run: yarn run lint

- name: Generate Changelog
id: generate_changelog
run: |
yarn run changelog:last --silent
changelog=$(yarn run changelog:last --silent)
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "${changelog}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Generate Changelog
id: generate_changelog
run: |
changelog=$(yarn run changelog:last --silent)
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "${changelog}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Check package version
uses: technote-space/package-version-check-action@v1
- name: Check package version
uses: technote-space/package-version-check-action@v1

- name: Make Package
run: npm pack
- name: Make Package
run: npm pack

- name: Rename Pack
run: mv *.tgz baileys-api.tgz
- name: Rename Pack
run: mv *.tgz baileys-api.tgz

- name: Create Release
uses: meeDamian/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
name: ${{ github.ref_name }}
body: ${{ steps.generate_changelog.outputs.changelog }}
draft: false
prerelease: false
files: >
baileys-api.tgz
gzip: folders
allow_override: true
- name: Create Release
uses: meeDamian/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
name: ${{ github.ref_name }}
body: ${{ steps.generate_changelog.outputs.changelog }}
draft: false
prerelease: false
files: >
baileys-api.tgz
gzip: folders
allow_override: true

0 comments on commit 9e06d47

Please sign in to comment.