From 792a7f7645a5dd206d9af4cd9e985e9aa02506c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dalfors?= Date: Wed, 27 Nov 2024 17:37:42 +0100 Subject: [PATCH] feat: set corresponding prerelease type derived from releaseType BREAKING CHANGE: prerelease option generates pre[major|minor|patch] release --- .github/workflows/test.yml | 8 ++++---- src/helpers/bumpVersion.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97eebb9d..5085beb1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -954,7 +954,7 @@ jobs: uses: ./ env: ENV: "dont-use-git" - EXPECTED_TAG: "v1.4.6-rc.0" + EXPECTED_TAG: "v1.5.0-rc.0" with: github-token: ${{ secrets.github_token }} version-file: "test-file.json" @@ -968,7 +968,7 @@ jobs: run: node ./test-output.js env: FILES: "test-file.json" - EXPECTED_VERSION: "1.4.6-rc.0" + EXPECTED_VERSION: "1.5.0-rc.0" test-pre-release-identifier: runs-on: ubuntu-latest @@ -990,7 +990,7 @@ jobs: uses: ./ env: ENV: "dont-use-git" - EXPECTED_TAG: "v1.4.6-alpha.0" + EXPECTED_TAG: "v1.5.0-alpha.0" with: github-token: ${{ secrets.github_token }} version-file: "test-file.json" @@ -1005,7 +1005,7 @@ jobs: run: node ./test-output.js env: FILES: "test-file.json" - EXPECTED_VERSION: "1.4.6-alpha.0" + EXPECTED_VERSION: "1.5.0-alpha.0" test-pre-release-to-stable: runs-on: ubuntu-latest diff --git a/src/helpers/bumpVersion.js b/src/helpers/bumpVersion.js index c3104912..c1509e41 100644 --- a/src/helpers/bumpVersion.js +++ b/src/helpers/bumpVersion.js @@ -17,7 +17,7 @@ module.exports = async (releaseType, version) => { const identifier = core.getInput('pre-release-identifier') if (version) { - newVersion = semver.inc(version, (prerelease ? 'prerelease' : releaseType), identifier) + newVersion = semver.inc(version, (prerelease ? `pre${releaseType}` : releaseType), identifier) } else { const fallbackVersion = core.getInput('fallback-version')