chore: release 0.14.2 #57
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 | |
| # Publishes the tsforge CLI to npm and creates a GitHub Release when a | |
| # semver tag v*.*.* is pushed. Version in packages/core/package.json | |
| # must match the tag (without the leading v). | |
| on: | |
| push: | |
| tags: ["v*.*.*"] | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| publish: | |
| name: npm publish + GitHub Release | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| fetch-depth: 0 # full history + tags so release notes can diff since the previous tag | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.3.14 | |
| - name: Cache bun install | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }} | |
| restore-keys: | | |
| bun-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Install ripgrep | |
| run: sudo apt-get update && sudo apt-get install -y ripgrep | |
| - name: Set up Node for npm | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Verify tag matches package version | |
| id: version | |
| run: | | |
| TAG="${GITHUB_REF_NAME#v}" | |
| PKG_VERSION=$(jq -r '.version' packages/core/package.json) | |
| if [ "$TAG" != "$PKG_VERSION" ]; then | |
| echo "Tag v${TAG} does not match packages/core/package.json version ${PKG_VERSION}." | |
| exit 1 | |
| fi | |
| echo "version=${PKG_VERSION}" >> "$GITHUB_OUTPUT" | |
| echo "Publishing @agjs/tsforge@${PKG_VERSION}" | |
| - name: Validate | |
| run: bun run validate | |
| - name: Publish to npm | |
| working-directory: packages/core | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| npm whoami | |
| npm publish --access public --provenance | |
| - name: Build release notes | |
| id: notes | |
| run: | | |
| set +e | |
| PREV_TAG=$(git describe --tags --abbrev=0 "${GITHUB_REF_NAME}^" 2>/dev/null) | |
| { | |
| echo "## What's changed" | |
| echo | |
| if [ -n "$PREV_TAG" ]; then | |
| echo "Since ${PREV_TAG}:" | |
| echo | |
| RANGE="${PREV_TAG}..${GITHUB_REF_NAME}" | |
| else | |
| RANGE="${GITHUB_REF_NAME}" | |
| fi | |
| # Drop the version-bump commit — it's noise in the changelog. | |
| git log --no-merges --pretty='- %s' "$RANGE" | { grep -vE '^- chore: release ' || true; } | |
| echo | |
| echo "## Install" | |
| echo | |
| echo '```bash' | |
| echo "bun install -g @agjs/tsforge@${{ steps.version.outputs.version }}" | |
| echo '```' | |
| echo | |
| echo "Or: \`curl -fsSL https://tsforge.dev/install.sh | bash\`" | |
| } > RELEASE_NOTES.md | |
| cat RELEASE_NOTES.md | |
| exit 0 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 | |
| with: | |
| body_path: RELEASE_NOTES.md |