|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - naga |
| 6 | + - canary-naga |
| 7 | + |
| 8 | +permissions: |
| 9 | + # allow pushing commits, creating tags, and modifying repo files |
| 10 | + # needed for the workflow to update package.json versions and CHANGELOG files |
| 11 | + contents: write |
| 12 | + pull-requests: write |
| 13 | + |
| 14 | +jobs: |
| 15 | + release: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Check NPM Token |
| 19 | + run: | |
| 20 | + if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then |
| 21 | + echo "❌ NODE_AUTH_TOKEN secret is not set. Please add it to repository secrets." |
| 22 | + exit 1 |
| 23 | + else |
| 24 | + echo "✅ NODE_AUTH_TOKEN secret is available." |
| 25 | + fi |
| 26 | +
|
| 27 | + - name: Checkout |
| 28 | + uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + # Enable this after PNPM migration |
| 33 | + # - name: Setup PNPM |
| 34 | + # uses: pnpm/action-setup@v4 |
| 35 | + # with: |
| 36 | + # version: 9.15.0 |
| 37 | + |
| 38 | + # TODO: Disable this after PNPM migration |
| 39 | + - name: Setup Bun |
| 40 | + uses: oven-sh/setup-bun@v1 |
| 41 | + with: |
| 42 | + bun-version: latest |
| 43 | + |
| 44 | + - name: Install rust |
| 45 | + uses: dtolnay/rust-toolchain@1.76.0 |
| 46 | + |
| 47 | + - name: Install wasm-pack |
| 48 | + uses: jetli/wasm-pack-action@v0.4.0 |
| 49 | + with: |
| 50 | + version: 'latest' |
| 51 | + |
| 52 | + - name: Setup Node |
| 53 | + uses: actions/setup-node@v4 |
| 54 | + with: |
| 55 | + node-version: '22.18.0' |
| 56 | + registry-url: 'https://registry.npmjs.org' |
| 57 | + |
| 58 | + - name: Install project dependencies |
| 59 | + run: bun install --frozen-lockfile |
| 60 | + # Enable this after PNPM migration |
| 61 | + # run: pnpm install --frozen-lockfile |
| 62 | + |
| 63 | + - name: Check current pre-release mode |
| 64 | + run: | |
| 65 | + if [ -f ".changeset/pre.json" ]; then |
| 66 | + echo "📋 Current pre-release mode status:" |
| 67 | + cat .changeset/pre.json | jq '{ mode: .mode, tag: .tag }' |
| 68 | + else |
| 69 | + echo "📋 Not in pre-release mode" |
| 70 | + fi |
| 71 | +
|
| 72 | + - name: Build |
| 73 | + env: |
| 74 | + NX_DAEMON: 'false' |
| 75 | + run: bun run build |
| 76 | + # Enable this after pnpm migration |
| 77 | + # run: pnpm build |
| 78 | + |
| 79 | + - name: Create Release Pull Request or Publish to npm |
| 80 | + id: changesets |
| 81 | + uses: changesets/action@v1 |
| 82 | + with: |
| 83 | + version: bunx changeset version |
| 84 | + publish: bunx changeset publish --access public |
| 85 | + # Enable this after pnpm migration |
| 86 | + # version: pnpm changeset version |
| 87 | + # publish: pnpm changeset publish --access public |
| 88 | + commit: 'chore(release): version packages' |
| 89 | + title: 'chore(release): version packages' |
| 90 | + env: |
| 91 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 92 | + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} |
0 commit comments