From 80c4c15d8b6818ece7335275aa7aeb148724d04c Mon Sep 17 00:00:00 2001 From: Gary <12258850+gtokman@users.noreply.github.com> Date: Wed, 11 Nov 2026 06:06:38 -0800 Subject: [PATCH 1/2] chore: bump version to 2.5.0 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49c1ba7..f9e200a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mta-js", - "version": "2.4.0", + "version": "2.5.0", "description": "A TypeScript client for MTA realtime feeds and the hosted MTA API.", "license": "MIT", "repository": { From e04273948c4631f0a9c202abf98ff175ed03f9ef Mon Sep 17 00:00:00 2001 From: Gary <12258850+gtokman@users.noreply.github.com> Date: Wed, 11 Nov 2026 06:07:08 -0800 Subject: [PATCH 2/2] ci: auto tag, release, and publish new versions on main Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/publish.yml | 38 +++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6ec79c2..9d6326a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,14 +3,17 @@ name: Publish Package on: workflow_dispatch: push: - tags: - - "v*" - - "[0-9]*" + branches: + - main permissions: - contents: read + contents: write id-token: write +concurrency: + group: publish + cancel-in-progress: false + jobs: publish: runs-on: ubuntu-latest @@ -19,22 +22,41 @@ jobs: - name: Checkout uses: actions/checkout@v6 + - name: Check for unpublished version + id: version + run: | + VERSION=$(node -p "require('./package.json').version") + NAME=$(node -p "require('./package.json').name") + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + if npm view "$NAME@$VERSION" version >/dev/null 2>&1; then + echo "$NAME@$VERSION is already on npm; skipping release." + echo "publish=false" >> "$GITHUB_OUTPUT" + else + echo "publish=true" >> "$GITHUB_OUTPUT" + fi + - name: Set up Bun + if: steps.version.outputs.publish == 'true' uses: oven-sh/setup-bun@v2 - name: Install dependencies + if: steps.version.outputs.publish == 'true' run: bun install --frozen-lockfile - name: Test + if: steps.version.outputs.publish == 'true' run: bun test - name: Typecheck + if: steps.version.outputs.publish == 'true' run: bun run typecheck - name: Pack dry run + if: steps.version.outputs.publish == 'true' run: bun pm pack --dry-run - name: Set up Node for npm publishing + if: steps.version.outputs.publish == 'true' uses: actions/setup-node@v6 with: node-version: "24" @@ -42,4 +64,12 @@ jobs: package-manager-cache: false - name: Publish to npm + if: steps.version.outputs.publish == 'true' run: npm publish + + - name: Tag and create GitHub release + if: steps.version.outputs.publish == 'true' + env: + GH_TOKEN: ${{ github.token }} + TAG: v${{ steps.version.outputs.version }} + run: gh release create "$TAG" --target "$GITHUB_SHA" --title "$TAG" --generate-notes