fix tag determination
This commit is contained in:
parent
4119a1fc7f
commit
5516a6f9c5
@ -30,15 +30,18 @@ jobs:
|
||||
- name: Build library
|
||||
run: yarn build
|
||||
|
||||
- name: Determine npm tag
|
||||
- name: Determine npm tag based on release type
|
||||
id: determine_tag
|
||||
run: |
|
||||
IS_PRERELEASE=${{ github.event.release.prerelease }}
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
if [[ "$VERSION" =~ -(alpha|beta|rc|dev) ]]; then
|
||||
# Access the prerelease flag from the Gitea release event payload
|
||||
# ${{ github.event.release.prerelease }} is the standard GitHub Actions syntax
|
||||
# Gitea Actions aims for compatibility, so this should work.
|
||||
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
|
||||
echo "NPM_TAG=dev" >> $GITHUB_OUTPUT
|
||||
echo "::notice::Release is a pre-release. Publishing with 'dev' tag."
|
||||
else
|
||||
echo "NPM_TAG=latest" >> $GITHUB_OUTPUT
|
||||
echo "::notice::Release is stable. Publishing with 'latest' tag."
|
||||
fi
|
||||
|
||||
- name: Publish to npm
|
||||
|
Loading…
Reference in New Issue
Block a user