Skip to content

Commit a5e6c8d

Browse files
committed
fix(ci): publish prerelease versions
1 parent 95d613f commit a5e6c8d

2 files changed

Lines changed: 13 additions & 45 deletions

File tree

.github/workflows/prerelease.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ on:
44
push:
55
tags:
66
- "v*"
7-
- "!v*-*"
87

98
permissions:
109
contents: write
11-
id-token: write
1210

1311
jobs:
14-
publish:
12+
publish-npm:
1513
runs-on: ubuntu-latest
14+
environment: publish-npm
15+
permissions:
16+
contents: write
17+
id-token: write
1618
steps:
1719
- uses: actions/checkout@v4
1820

@@ -39,9 +41,16 @@ jobs:
3941
run: npm pack --dry-run
4042

4143
- name: Publish package
42-
run: npm publish --provenance --access public
44+
run: |
45+
if [[ "$GITHUB_REF_NAME" == *-* ]]; then
46+
npm_tag=next
47+
else
48+
npm_tag=latest
49+
fi
50+
npm publish --provenance --access public --tag "$npm_tag"
4351
4452
- name: Create GitHub release
53+
if: ${{ !contains(github.ref_name, '-') }}
4554
env:
4655
GH_TOKEN: ${{ github.token }}
4756
run: gh release create "${{ github.ref_name }}" --generate-notes

0 commit comments

Comments
 (0)