Skip to content

Commit

Permalink
fix: fuzzy match on pre-release version (#72)
Browse files Browse the repository at this point in the history
* Fix pre-release flow

* fix empty comment
  • Loading branch information
EmandM authored May 15, 2024
1 parent f8fe7b5 commit 58c08f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,21 @@ jobs:

- id: update_version
name: Update Package Version
env:
PREID: rc
run: |
echo foo > bar.txt
set -e
if [[ ${{ inputs.prerelease }} ]]; then
echo "creating prerelease version"
# save the value would be created, then remove all changes
current_version=$(npm pkg get version | sed 's/"//g')
if [[ current_version == *${PREID}* ]]; then
echo "first prerelease version"
# if the current version is a prerelease, we can just bump the prerelease number
echo "Creating prerelease version. Current version is $current_version"
if [[ current_version =~ "rc" ]]; then
echo "subsequent prerelease version"
# as current version is a prerelease, we can just bump the prerelease number
new_version=$(npm version prerelease --sign-git-tag -m "Create prererelease version %s" )
else
echo "subsequent prerelease version"
# if the current version is not a prerelease, we need to add a prerelease number
new_version=$(npm version --preid=${PREID} pre${{ inputs.semver_type }} --sign-git-tag -m "Create prererelease version %s" )
echo "first prerelease version"
# if not a prerelease, we need to create a prerelease version
new_version=$(npm version --preid="rc" pre${{ inputs.semver_type }} --sign-git-tag -m "Create prererelease version %s" )
fi
else
echo "creating new release"
Expand All @@ -79,6 +76,7 @@ jobs:
tag: "${{ steps.update_version.outputs.version_number }}"
generateReleaseNotes: true
prerelease: ${{ inputs.prerelease }}
draft: false


publish-npm:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-mock-imports",
"version": "1.3.18-rc.0",
"version": "1.3.16-rc.0",
"description": "Intuitive mocking for Typescript class imports",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down

0 comments on commit 58c08f5

Please sign in to comment.