v0.2.2-alpha.4+1 #7
Workflow file for this run
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 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| name: Build and Publish | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| # Check out the release tag ref explicitly. On `release`-triggered | |
| # runs, checkout otherwise lands on a detached commit with no tag ref | |
| # (actions/checkout#2280), which makes `npm publish --provenance` fail | |
| # with "422 ... Missing SourceRepositoryRef in signing certificate". | |
| ref: ${{ github.event.release.tag_name }} | |
| - name: Cache turbo build setup | |
| uses: actions/cache@v5 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build all packages | |
| run: bun run build | |
| - name: Run tests | |
| run: bun run test | |
| - name: Run linting | |
| run: bun run lint | |
| - name: Replace workspace protocols with versions | |
| run: bun run scripts/replace-workspace-protocols.ts | |
| - name: Publish to NPM | |
| run: | | |
| for PKG in packages/*; do | |
| if [ -f "$PKG/package.json" ]; then | |
| echo "Publishing $PKG ..." | |
| (cd "$PKG" && npm publish --provenance --access public --tag alpha) | |
| fi | |
| done | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| tag: | |
| name: Add NPM Tag (${{ matrix.tag }}) | |
| runs-on: ubuntu-latest | |
| needs: publish | |
| environment: npm | |
| strategy: | |
| matrix: | |
| tag: [alpha, latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Add ${{ matrix.tag }} tag to all packages | |
| run: | | |
| for PKG_JSON in packages/*/package.json; do | |
| PKG_NAME=$(jq -r '.name' "$PKG_JSON") | |
| PKG_VERSION=$(jq -r '.version' "$PKG_JSON") | |
| if [ "$PKG_NAME" != "null" ] && [ "$PKG_VERSION" != "null" ]; then | |
| echo "Adding ${{ matrix.tag }} tag to $PKG_NAME@$PKG_VERSION" | |
| npm dist-tag add "$PKG_NAME@$PKG_VERSION" ${{ matrix.tag }} || echo "Failed to tag $PKG_NAME" | |
| fi | |
| done | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |