Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,33 @@ on:
release:
types:
- published
- edited

jobs:
# When a prerelease is edited to a full release, just promote the npm tag
promote:
if: github.event.action == 'edited' && !github.event.release.prerelease && !github.event.release.draft && github.event.changes.prerelease.from == true
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install node 20
uses: actions/setup-node@v6
with:
node-version: '20'
registry-url: https://registry.npmjs.org
- name: Promote edge to latest
run: |
VERSION=$(echo "$TAG_NAME" | sed 's/^v//')
PACKAGE=$(node -p "require('./package.json').name")
npm dist-tag add "$PACKAGE@$VERSION" latest
echo "::notice title=Promoted $VERSION to latest::The latest tag now points to $VERSION (was edge-only)"
env:
TAG_NAME: ${{ github.event.release.tag_name }}
NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}}

deploy:
if: github.event.action == 'published'
runs-on: ${{ matrix.os }}
env:
TERM: xterm
Expand Down
Loading