Skip to content

Commit

Permalink
Accurately create prerelease tags
Browse files Browse the repository at this point in the history
  • Loading branch information
EmandM committed May 15, 2024
1 parent 98b3a0c commit 93a5523
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,22 @@ jobs:

- id: update_version
name: Update Package Version
env:
PREID: rc
run: |
echo foo > bar.txt
set -e
if [[ ${{ inputs.prerelease }} ]]; then
# save the value would be created, then remove all changes
new_version=$(npm version ${{ inputs.semver_type }} --no-commit-hooks --no-git-tag-version )
current_version=$(npm pkg get version | sed 's/"//g')
if [[ current_version == *${PREID}* ]]; then
# if the current version is a prerelease, we can just bump the prerelease number
new_version=$(npm version prerelease --no-commit-hooks --no-git-tag-version)
else
# if the current version is not a prerelease, we need to add a prerelease number
new_version=$(npm version --no-commit-hooks --no-git-tag-version --preid=${PREID} pre${{ inputs.semver_type }})
fi
git reset --hard
else
new_version=$(npm version ${{ inputs.semver_type }} --sign-git-tag )
Expand Down

0 comments on commit 93a5523

Please sign in to comment.