diff --git a/.github/workflows/release-and-publish.yml b/.github/workflows/release-and-publish.yml index 122f589..6065ec5 100644 --- a/.github/workflows/release-and-publish.yml +++ b/.github/workflows/release-and-publish.yml @@ -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" @@ -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 diff --git a/package-lock.json b/package-lock.json index 0428eea..6d6bfd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-mock-imports", - "version": "1.3.17-rc.0", + "version": "1.3.16-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ts-mock-imports", - "version": "1.3.17-rc.0", + "version": "1.3.16-rc.0", "license": "MIT", "devDependencies": { "@eslint/js": "^9.2.0", diff --git a/package.json b/package.json index 0475062..fbfd5cc 100644 --- a/package.json +++ b/package.json @@ -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",