Skip to content

Commit

Permalink
fix: version checks (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmandM authored May 15, 2024
1 parent 8910ea4 commit d9fafb9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,23 @@ jobs:

- id: update_version
name: Update Package Version
env:
PREID: rc
run: |
echo foo > bar.txt
set -e
if [[ ${{ inputs.prerelease }} ]]; then
current_version=$(npm pkg get version | sed 's/"//g')
echo "Creating prerelease version. Current version is $current_version"
if [[ current_version =~ "rc" ]]; then
echo "Creating prerelease version. Current version is ${current_version}"
if [[ ${current_version} =~ ${PREID} ]]; 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 "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" )
new_version=$(npm version --preid=${PREID} pre${{ inputs.semver_type }} --sign-git-tag -m "Create prererelease version %s" )
fi
else
echo "creating new release"
Expand All @@ -72,6 +74,7 @@ jobs:
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ steps.pack_tar.outputs.tar_name }}"
tag: "${{ steps.update_version.outputs.version_number }}"
generateReleaseNotes: true
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.17-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 d9fafb9

Please sign in to comment.