ugh8dhadhui (#1483)

* now we can do this

* Bump to 21.0.1

* Update build-macos.yml

* fix AirPlay metadata , down el

* chore: Updated Lockfile

* delete pnpm cache

* ok

* fix CI

* ok

* force CI

* chore: Prettified Code
 [ci skip]

* airplay no longer experimental

* chore: Updated Lockfile

* Environment variable for release version run

* chore: Updated Lockfile

* Two version outputted by script

* what

* Persist .git

* les try this

* aa

* pls

* test

* pogchamp

* balls

* chore: Updated Lockfile

* this triggered me

* you should not be here.

* bruhmoment

* yawn

* chore: Updated Lockfile

* Remove this temporarily.

* Remove this too.

* chore: Updated Lockfile

* c2 i18n sync

* Implement SetRepeat to WSAPI

* chore: Updated Lockfile

Co-authored-by: Core <core@coredev.uk>
Co-authored-by: cryptofyre <cryptofyre@cryptofyre.org>
Co-authored-by: vapormusic <vietanhfat@gmail.com>
Co-authored-by: vapormusic <vapormusic@users.noreply.github.com>
Co-authored-by: coredev-uk <coredev-uk@users.noreply.github.com>
Co-authored-by: cryptofyre <cryptofyre@users.noreply.github.com>
Co-authored-by: booploops <49113086+booploops@users.noreply.github.com>
Co-authored-by: Amaru8 <52407090+Amaru8@users.noreply.github.com>
Co-authored-by: Amaru8 <Amaru8@users.noreply.github.com>
This commit is contained in:
yazninja 2022-10-05 21:03:34 +08:00 committed by GitHub
parent 2b38c0498c
commit ec70754a64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 177 additions and 132 deletions

View file

@ -9,21 +9,36 @@ else
STABLE_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4)
fi
SHA_DATE=$(git show -s --format=%ci $STABLE_SHA)
COMMIT_SINCE_STABLE=$(printf "%03d\n" $(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE"))
CURRENT_VERSION=$(node -p -e "require('./package.json').version")
VERSION_POSTFIX=$(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE")
CURRENT_VERSION=$(node -p -e "require('./package.json').version" | cut -d '-' -f 1)
# Set the version number for commits on main branch
if [[ ($CIRCLE_BRANCH == "main" || $GITHUB_REF_NAME == "main") && $COMMIT_SINCE_STABLE -gt 0 && $(node -p -e "require('./package.json').version" | cut -d '.' -f 4) != $COMMIT_SINCE_STABLE ]]; then
NEW_VERSION="${CURRENT_VERSION}-beta.${COMMIT_SINCE_STABLE}"
if [[ ($CIRCLE_BRANCH == "main" || $GITHUB_REF_NAME == "main") && $VERSION_POSTFIX -gt 0 ]]; then
NEW_VERSION_NUMBERED="$CURRENT_VERSION-beta.$(printf "%03d\n" $VERSION_POSTFIX)"
NEW_VERSION="${CURRENT_VERSION}-beta.${VERSION_POSTFIX}"
# Update the version in package.json
if [[ $RUNNER_OS == "macOS" ]]; then
sed -i "" -e "s/$CURRENT_VERSION/$NEW_VERSION/" package.json
else
sed -i "0,/$CURRENT_VERSION/s//$NEW_VERSION/" package.json
fi
echo $NEW_VERSION
if [[ $NO_WRITE_VER == "" && $(node -p -e "require('./package.json').version" | cut -d '.' -f 4) != $VERSION_POSTFIX ]]; then
if [[ $RUNNER_OS == "macOS" ]]; then
sed -i "" -e "s/$CURRENT_VERSION/$NEW_VERSION/" package.json
else
sed -i "0,/$CURRENT_VERSION/s//$NEW_VERSION/" package.json
fi
fi
else
echo $CURRENT_VERSION
NEW_VERSION_NUMBERED=$CURRENT_VERSION
NEW_VERSION=$CURRENT_VERSION
fi
echo $NEW_VERSION
# Add the version to the environment for CI usage
if [[ $GITHUB_REF_NAME != "" ]]; then
echo "APP_VERSION=$NEW_VERSION" >>$GITHUB_ENV
echo "RELEASE_VERSION=$NEW_VERSION_NUMBERED" >>$GITHUB_ENV
elif [[ $CIRCLE_BRANCH != "" ]]; then
echo "export APP_VERSION=$NEW_VERSION" >>$BASH_ENV
echo "export RELEASE_VERSION=$NEW_VERSION_NUMBERED" >>$BASH_ENV
fi