From 58c08f56b9ecac41b08cd78b5de75784fd4db847 Mon Sep 17 00:00:00 2001 From: Emma Date: Wed, 15 May 2024 18:06:10 -0400 Subject: [PATCH] fix: fuzzy match on pre-release version (#72) * Fix pre-release flow * fix empty comment --- .github/workflows/release-and-publish.yml | 18 ++++++++---------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-and-publish.yml b/.github/workflows/release-and-publish.yml index 80bf356..122f589 100644 --- a/.github/workflows/release-and-publish.yml +++ b/.github/workflows/release-and-publish.yml @@ -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" @@ -79,6 +76,7 @@ jobs: tag: "${{ steps.update_version.outputs.version_number }}" generateReleaseNotes: true prerelease: ${{ inputs.prerelease }} + draft: false publish-npm: diff --git a/package-lock.json b/package-lock.json index 9cb88ed..6d6bfd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-mock-imports", - "version": "1.3.18-rc.0", + "version": "1.3.16-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ts-mock-imports", - "version": "1.3.18-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 b184223..fbfd5cc 100644 --- a/package.json +++ b/package.json @@ -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",