Release #4
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
# .github/workflows/release.yml | |
name: Release | |
permissions: | |
contents: write | |
on: workflow_dispatch | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup npmrc | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc | |
- name: Install Pnpm | |
run: corepack enable | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
- 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: | | |
git tag ${{ steps.version_to_release.outputs.result }} | |
git push origin ${{ steps.version_to_release.outputs.result }} | |
pnpm -r publish --no-git-checks | |
- name: GitHub Release | |
run: pnpx changelogithub | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |