Publish #1
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: Publish | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish: | |
| name: Publish rssbook to npm | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 | |
| with: | |
| bun-version: 1.3.2 | |
| - 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 --frozen-lockfile | |
| - name: Verify package version matches tag | |
| working-directory: pkgs/rssbook | |
| run: | | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then | |
| echo "::error::package.json version ($PACKAGE_VERSION) does not match tag (v$TAG_VERSION)" | |
| exit 1 | |
| fi | |
| fi | |
| echo "Publishing version $PACKAGE_VERSION" | |
| - name: Lint, Format & Type Check | |
| run: bun run check | |
| - name: Run Tests | |
| run: bun test ./pkgs/rssbook/src/tests | |
| - name: Build | |
| run: bun run build | |
| - name: Publish to npm | |
| working-directory: pkgs/rssbook | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |