Skip to content

Commit c2d7486

Browse files
committed
ci(release): keep latest in sync with each release
Until now the workflow only moved the bridge tag, so latest would have drifted back to the 0.0.0 placeholder on the next release (what bit users in issue #8 before it was fixed manually). After publishing under --tag bridge, point latest at the same version for the main package and all seven platform packages; switch the step off when a stable line takes over latest.
1 parent ec593dd commit c2d7486

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,20 @@ jobs:
187187
env:
188188
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
189189

190+
- name: Point latest at the release
191+
# The bridge line is the only real content today; keep `latest` in sync
192+
# so bare `npm i` never resolves to a stale placeholder (issue #8).
193+
# dist-tag add needs no OTP under trusted publishing/OIDC.
194+
run: |
195+
set -euo pipefail
196+
V="$(node -p "require('./staging/package.json').version")"
197+
npm dist-tag add "typescript-native-bridge@$V" latest
198+
for p in darwin-arm64 darwin-x64 linux-x64 linux-arm64 linux-arm win32-x64 win32-arm64; do
199+
npm dist-tag add "@typescript-native-bridge/$p@$V" latest
200+
done
201+
env:
202+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
203+
190204
- name: Create GitHub Release
191205
run: gh release create "${GITHUB_REF_NAME}" --generate-notes --verify-tag
192206
env:

0 commit comments

Comments
 (0)