Release #55
This file contains hidden or 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: | |
| id-token: write # Required for OIDC | |
| contents: write | |
| on: workflow_dispatch | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| # Update npm to the latest version to enable OIDC | |
| # Use corepack to install pnpm | |
| - name: Setup Package Managers | |
| run: | | |
| npm install -g npm@latest | |
| npm --version | |
| npm install -g corepack@latest --force | |
| corepack enable | |
| - name: Install Dependencies and build | |
| run: pnpm install --frozen-lockfile | |
| - 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}} |