Skip to content

Commit 9bed67f

Browse files
authored
Merge pull request #10 from reside-eng/ci/publish-floating-major-tag
ci: publish floating major version tag and stop committing dist
2 parents 0824650 + 795c638 commit 9bed67f

4 files changed

Lines changed: 9 additions & 37228 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ jobs:
7676
env:
7777
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7878

79-
- name: Push updates to branch for major version
80-
# If a new version is published, i.e. v1.2.3 then this step will update
81-
# branch "v1" to this commit.
79+
- name: Publish floating major version tag
80+
# If a new version is published, i.e. v1.2.3 then this step force-moves
81+
# the floating major tag "v1" to this commit, so consumers can pin @v1 and
82+
# Renovate (github-tags datasource reads tags, not branches) can track it.
8283
# https://github.com/reside-eng/npm-dependency-stats-action/branches
8384
# The dist folder (built) is included so that action can be used directly from Github
8485
# ref (where exact versions can pull from npm)
@@ -92,7 +93,9 @@ jobs:
9293
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
9394
git add --force dist
9495
git commit -C HEAD --amend
95-
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}
96+
MAJOR_TAG="v${{steps.semantic.outputs.new_release_major_version}}"
97+
git tag -f "${MAJOR_TAG}"
98+
git push -f https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git "refs/tags/${MAJOR_TAG}"
9699
97100
notification:
98101
if: always()

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ node_modules
99

1010
# coverage + build artifacts
1111
coverage
12+
dist
1213

1314
# IDE
1415
.vscode/*

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ yarn build # rimraf dist/ && node build.mjs (esbuild → dist/index
2727
- Conventional Commits via commitlint (`commit-msg` hook). Use `feat!:` or a `BREAKING CHANGE:` footer to trigger a semantic-release major bump.
2828
- Pre-commit auto-restages Biome fixes and runs `tsc --noEmit`. Never `--no-verify` — fix the underlying issue.
2929
- Relative imports use the `.js` extension; Node built-ins use the `node:` protocol.
30-
- `dist/` is gitignored on `main`. The release workflow rebuilds `dist/index.mjs` and force-commits it to the `v<major>` branch on each release — do not edit `dist/` by hand.
30+
- `dist/` is gitignored on `main`. The release workflow rebuilds `dist/index.mjs` and force-adds it to the floating major tag (`refs/tags/v<major>`) on each release, so `@vN` resolves a runnable bundle — do not edit `dist/` by hand. Full-version tags (`vX.Y.Z`) do **not** carry `dist/`; always consume via `@vN`.

0 commit comments

Comments
 (0)