|
5 | 5 | branches: [naga, canary-naga] |
6 | 6 | pull_request: |
7 | 7 |
|
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + pull-requests: write |
| 11 | + |
8 | 12 | jobs: |
9 | 13 | build: |
10 | 14 | name: Build once |
@@ -100,3 +104,64 @@ jobs: |
100 | 104 | - name: Run health check (${{ matrix.network }}) |
101 | 105 | run: NETWORK=${{ matrix.network }} pnpm run test:e2e:ci -- packages/e2e/src/e2e.spec.ts --testNamePattern "^all " |
102 | 106 | timeout-minutes: 10 |
| 107 | + |
| 108 | + release: |
| 109 | + name: Release |
| 110 | + needs: e2e |
| 111 | + runs-on: ubuntu-latest |
| 112 | + if: github.event_name == 'push' && needs.e2e.result == 'success' |
| 113 | + steps: |
| 114 | + - name: Check NPM Token |
| 115 | + run: | |
| 116 | + if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then |
| 117 | + echo "❌ NODE_AUTH_TOKEN secret is not set. Please add it to repository secrets." |
| 118 | + exit 1 |
| 119 | + else |
| 120 | + echo "✅ NODE_AUTH_TOKEN secret is available." |
| 121 | + fi |
| 122 | +
|
| 123 | + - uses: actions/checkout@v4 |
| 124 | + with: |
| 125 | + fetch-depth: 0 |
| 126 | + ref: ${{ github.ref }} |
| 127 | + |
| 128 | + - uses: actions/setup-node@v4 |
| 129 | + with: |
| 130 | + node-version: 22.18.0 |
| 131 | + registry-url: https://registry.npmjs.org |
| 132 | + cache: pnpm |
| 133 | + cache-dependency-path: pnpm-lock.yaml |
| 134 | + |
| 135 | + - name: Enable corepack + pin pnpm |
| 136 | + run: | |
| 137 | + corepack enable |
| 138 | + corepack prepare [email protected] --activate |
| 139 | +
|
| 140 | + - uses: actions-rs/toolchain@v1 |
| 141 | + with: |
| 142 | + toolchain: stable |
| 143 | + override: true |
| 144 | + components: rust-std |
| 145 | + |
| 146 | + |
| 147 | + with: |
| 148 | + version: latest |
| 149 | + |
| 150 | + - name: Install Dependencies |
| 151 | + run: pnpm install --frozen-lockfile |
| 152 | + |
| 153 | + - name: Build packages |
| 154 | + run: pnpm run build |
| 155 | + |
| 156 | + - name: Create Release Pull Request or Publish to npm |
| 157 | + id: changesets |
| 158 | + uses: changesets/action@v1 |
| 159 | + with: |
| 160 | + branch: ${{ github.ref_name }} |
| 161 | + version: pnpm changeset version |
| 162 | + publish: pnpm changeset publish --access public |
| 163 | + commit: chore(release): version packages |
| 164 | + title: chore(release): version packages |
| 165 | + env: |
| 166 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 167 | + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} |
0 commit comments