mirror of
https://github.com/fluencelabs/fluence-network-environment
synced 2024-12-03 15:50:17 +00:00
change increment algorithm
This commit is contained in:
parent
8a91187bdb
commit
e24c180454
16
.github/workflows/publish_release.yml
vendored
16
.github/workflows/publish_release.yml
vendored
@ -26,12 +26,20 @@ jobs:
|
||||
set -x
|
||||
yarn global add semver
|
||||
PATH="$(yarn global bin):$PATH"
|
||||
LOCAL_VERSION="$(cat package.json | jq -r .version)"
|
||||
|
||||
# take npm version and increment it
|
||||
PKG_NAME="$(cat package.json | jq .name)"
|
||||
NPM_VERSION="$(yarn info --silent "$PKG_NAME" version || true)"
|
||||
MAX_VERSION="$(semver "$LOCAL_VERSION" "$NPM_VERSION" "0.0.0" | tail -n1)"
|
||||
FINAL_VERSION="$(semver --increment patch "$MAX_VERSION")"
|
||||
echo "FINAL_VERSION=$FINAL_VERSION" | tee -a $GITHUB_ENV
|
||||
NEXT_NPM_VERSION="$(semver --increment patch "$NPM_VERSION")"
|
||||
|
||||
# take local version
|
||||
LOCAL_VERSION="$(cat package.json | jq -r .version)"
|
||||
|
||||
# take maximum of the local and NEXT_NPM versions
|
||||
MAX_VERSION="$(semver "$LOCAL_VERSION" "$NEXT_NPM_VERSION" "0.0.0" | tail -n1)"
|
||||
|
||||
# save version to env
|
||||
echo "FINAL_VERSION=$MAX_VERSION" | tee -a $GITHUB_ENV
|
||||
|
||||
### Set version
|
||||
- name: Set version to ${{ env.FINAL_VERSION }}
|
||||
|
Loading…
Reference in New Issue
Block a user