chore(release): add pre-release mode step to release workflow #25
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
| name: Release | |
| on: | |
| push: | |
| branches: ['dev/test-ci'] | |
| permissions: | |
| # allow pushing commits, creating tags, and modifying repo files | |
| # needed for the workflow to update package.json versions and CHANGELOG files | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check NPM Token | |
| run: | | |
| if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then | |
| echo "❌ NODE_AUTH_TOKEN secret is not set. Please add it to repository secrets." | |
| exit 1 | |
| else | |
| echo "✅ NODE_AUTH_TOKEN secret is available." | |
| fi | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| components: rust-std | |
| - name: Install wasm-pack | |
| uses: jetli/[email protected] | |
| with: | |
| version: 'latest' | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.18.0' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Enter pre-release mode | |
| run: pnpm changeset pre enter test | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm changeset publish --access public --tag test | |
| commit: 'chore(release): version packages' | |
| title: 'chore(release): version packages' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} |