From 10b41fc8b25a9b0346c30362e3be6da0bd35be25 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Mon, 27 Feb 2023 11:00:04 +0100 Subject: [PATCH] fix: Own version update fix (#3196) --- .github/update_own_version.sh | 13 +++++++++++++ .../workflows/continuous-publish-new-version.yaml | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100755 .github/update_own_version.sh diff --git a/.github/update_own_version.sh b/.github/update_own_version.sh new file mode 100755 index 0000000000..0a9022c389 --- /dev/null +++ b/.github/update_own_version.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +CURRENT_VERSION=$(npm pkg get version) + +if [[ $CURRENT_VERSION == *beta* ]]; then + echo "Current beta update" + npm version prerelease --preid=beta --ignore-scripts +else + echo "Next minor beta update" + npm version preminor --preid=beta --ignore-scripts +fi diff --git a/.github/workflows/continuous-publish-new-version.yaml b/.github/workflows/continuous-publish-new-version.yaml index c55f3133a7..3477f61197 100644 --- a/.github/workflows/continuous-publish-new-version.yaml +++ b/.github/workflows/continuous-publish-new-version.yaml @@ -35,14 +35,14 @@ jobs: with: node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' - - name: update package version # This step always creates beta version # sample transition after official release: 4.20.0 -> 4.21.0-beta.0 # sample transition after previous beta release: 4.21.0-beta.0 -> 4.21.0-beta.1 - # - # The new version is pushed back to master and to npm + - name: update own version + run: .github/update_own_version.sh + - name: push new version + # The new version is pushed back to main and to npm run: | - npm version prerelease --preid=beta --ignore-scripts git push origin ${{ github.ref_name }} git push --tags env: