chore(release): v0.5.0 – code cleanup, workflow improvements, and min… #21
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 (npm) | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # e.g. v0.1.0 | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write # for npm provenance | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| # Fallback, in case the runner image changes and pnpm isn't on PATH yet | |
| - name: Install pnpm (manual fallback) | |
| run: npm install -g pnpm@9 | |
| - name: Install deps | |
| run: pnpm install --frozen-lockfile | |
| - name: Test | |
| run: pnpm -r test | |
| # Build UI once (CLI prepack will only sync/copy) | |
| - name: Build UI (so CLI prepack is fast) | |
| run: pnpm -C packages/ui build | |
| # Safety: verify git tag matches package versions | |
| - name: Verify versions match tag | |
| run: | | |
| TAG="${GITHUB_REF_NAME#v}" | |
| echo "Tag is: $TAG" | |
| jq -r '.version' packages/core/package.json | grep -x "$TAG" | |
| jq -r '.version' packages/cli/package.json | grep -x "$TAG" | |
| jq -r '.version' packages/create-statikapi/package.json | grep -x "$TAG" | |
| echo "✔ versions match" | |
| # Optional sanity checks before publish | |
| - name: Pack dry-run (core) | |
| working-directory: packages/core | |
| run: npm pack --dry-run | |
| # IMPORTANT: actually pack the CLI (no dry-run), inspect tarball, then delete | |
| - name: Pack & verify (cli) | |
| working-directory: packages/cli | |
| run: | | |
| PKG="$(npm pack | tail -n1)" | |
| echo "Tarball: $PKG" | |
| # Check that bin and ui are in the tarball (tarballs are rooted at 'package/') | |
| tar -tf "$PKG" | grep -E '^package/bin/statikapi\.js$' | |
| tar -tf "$PKG" | grep -E '^package/ui/index\.html$' | |
| tar -tf "$PKG" | grep -E '^package/ui/assets/.+' | |
| rm -f "$PKG" | |
| - name: Pack dry-run (create-statikapi) | |
| working-directory: packages/create-statikapi | |
| run: npm pack --dry-run | |
| # Publish order: core → cli → create-statikapi | |
| - name: Publish @statikapi/core | |
| working-directory: packages/core | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public --provenance | |
| - name: Publish statikapi (CLI) | |
| working-directory: packages/cli | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public --provenance | |
| - name: Publish create-statikapi | |
| working-directory: packages/create-statikapi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public --provenance |