Skip to content

Commit 520d928

Browse files
committed
ci: publish to latest only from main
1 parent d947273 commit 520d928

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ permissions:
99
id-token: write
1010
contents: read
1111

12+
env:
13+
latest: ${{ github.event.ref == 'refs/heads/main' }}
14+
1215
jobs:
1316
gh-release:
1417
name: Create GitHub Release
@@ -22,7 +25,7 @@ jobs:
2225
- name: Create release
2326
env:
2427
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
run: gh release create "$GITHUB_REF_NAME" --generate-notes
28+
run: gh release create "$GITHUB_REF_NAME" --generate-notes --latest=${{ env.latest }}
2629

2730
publish-npm:
2831
name: Publish to NPM
@@ -43,4 +46,4 @@ jobs:
4346
- name: Publish to NPM
4447
env:
4548
NPM_CONFIG_PROVENANCE: true
46-
run: pnpm publish --no-git-checks
49+
run: pnpm publish --no-git-checks --tag=${{ case(env.latest, 'latest', 'backport') }}

0 commit comments

Comments
 (0)