Skip to content

Commit

Permalink
chore: tweak release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed May 20, 2024
1 parent 92dc38a commit 0ab5c23
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
Expand All @@ -28,9 +30,20 @@ jobs:
- name: Install Dependencies and build
run: pnpm install

- uses: actions/github-script@v7
id: version_to_release
with:
result-encoding: string
script: |
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('./packages/builder-rsbuild/package.json', 'utf8'));
return 'v' + packageJson.version;
- name: Publish to NPM
run: |
pnpm changeset publish
git tag ${{ steps.version_to_release.outputs.result }}
git push origin ${{ steps.version_to_release.outputs.result }}
pnpm -r publish
- name: GitHub Release
run: pnpx changelogithub
Expand Down

0 comments on commit 0ab5c23

Please sign in to comment.