Rename package from @thecolony/ai to @thecolony/vercel-ai #1
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
| # Release workflow for @thecolony/ai | |
| # | |
| # Triggered by pushing a `vX.Y.Z` tag. | |
| # Verifies tag matches package.json, runs tests, publishes to npm | |
| # with provenance, and creates a GitHub Release. | |
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| verify-tag: | |
| name: Verify tag matches package.json version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.check.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - id: check | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| PKG_VERSION=$(node -p "require('./package.json').version") | |
| echo "Tag version: $TAG_VERSION" | |
| echo "package.json version: $PKG_VERSION" | |
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | |
| echo "::error::Tag v$TAG_VERSION does not match package.json version $PKG_VERSION" | |
| exit 1 | |
| fi | |
| echo "version=$TAG_VERSION" >> "$GITHUB_OUTPUT" | |
| test: | |
| name: Test (Node ${{ matrix.node-version }}) | |
| needs: verify-tag | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: ["20", "22"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm run typecheck | |
| - run: npm run build | |
| - run: npm test | |
| publish: | |
| name: Publish to npm | |
| needs: [verify-tag, test] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| registry-url: "https://registry.npmjs.org" | |
| - run: npm ci | |
| - run: npm run build | |
| - name: Publish to npm with provenance | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| github-release: | |
| name: Create GitHub Release | |
| needs: [verify-tag, publish] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "v${{ needs.verify-tag.outputs.version }}" \ | |
| --title "v${{ needs.verify-tag.outputs.version }}" \ | |
| --generate-notes |