Fallback for macos builds
This commit is contained in:
parent
f426935cce
commit
a97340c7cc
1 changed files with 5 additions and 0 deletions
|
@ -4,11 +4,16 @@ STABLE_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable
|
|||
SHA_DATE=$(git show -s --format=%ci $STABLE_SHA)
|
||||
COMMITSINCESTABLE=$(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE")
|
||||
CURRENT_VERSION=$(node -p -e "require('./package.json').version")
|
||||
LATEST_VERSION=$(curl -s https://api.github.com/repos/ciderapp/cider-releases/releases/latest | grep tag_name | cut -d '"' -f 4 | sed 's/v//' | sed 's/\-/./g' | xargs)
|
||||
|
||||
# Set the version number for commits on main branch
|
||||
if [[ ($CIRCLE_BRANCH == "main" || $GITHUB_REF_NAME == "main") && $COMMITSINCESTABLE -gt 0 ]]; then
|
||||
NEW_VERSION="${CURRENT_VERSION}-beta.${COMMITSINCESTABLE}"
|
||||
|
||||
if [[ $GITHUB_REF_NAME != "" && $LATEST_VERSION != $NEW_VERSION ]]; then
|
||||
NEW_VERSION="${LATEST_VERSION}"
|
||||
fi
|
||||
|
||||
# Update the version in package.json
|
||||
if [[ $RUNNER_OS == "macOS" ]]; then
|
||||
sed -i "" -e "s/$CURRENT_VERSION/$NEW_VERSION/" package.json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue