Two version outputted by script
This commit is contained in:
parent
b8f661840a
commit
9feb23155e
3 changed files with 35 additions and 25 deletions
|
@ -133,19 +133,18 @@ jobs:
|
|||
- run:
|
||||
name: Run Version Script
|
||||
command: |
|
||||
sudo chmod +x resources/version.sh && GH_RELEASE_REQUEST=true ./resources/version.sh || true
|
||||
echo "export APP_VERSION=$(node -p -e 'require("./package.json").version')" >>$BASH_ENV
|
||||
sudo chmod +x resources/version.sh && NO_WRITE_VER=true ./resources/version.sh || true
|
||||
- run:
|
||||
name: Publish Release
|
||||
command: |
|
||||
echo "Attempting to create release for Cider v${APP_VERSION} on the ${CIRCLE_BRANCH} branch.";
|
||||
echo "Attempting to create release for Cider v${RELEASE_VERSION} on the ${CIRCLE_BRANCH} branch.";
|
||||
if [[ "${APP_VERSION}" = *"beta"* ]]; then
|
||||
echo $'**Beta Release**\nA full changelog is unavailable, but you can view the branch comparison [here](https://github.com/ciderapp/cider/compare/stable...main).\nThese builds are considered bleeding edge, expect bugs and please do not use this as a representation of the fu ll app.\nOur full support disclaimer can be found [here](https://docs.cider.sh/support/disclaimer#support-nightly-beta-releases).' > release-notes.md
|
||||
gh release create "v${APP_VERSION}" --prerelease --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes-file release-notes.md -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap
|
||||
gh release create "v${RELEASE_VERSION}" --prerelease --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes-file release-notes.md -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap
|
||||
curl -s http://129.146.42.180/api/v1/github/sync/main
|
||||
else
|
||||
echo $'**Stable Release**\nA full changelog is unavailable, but you can view the branch comparison [here](https://github.com/ciderapp/cider/compare/stable...main).\nThese are the most stable builds we can provide. If you experience any issues, please report them [here](https://github.com/ciderapp/cider/issues/new).\nOur full support disclaimer can be found [here](https://docs.cider.sh/support/disclaimer#support-releases).' > release-notes.md
|
||||
gh release create "v${APP_VERSION}" --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes-file release-notes.md -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap
|
||||
gh release create "v${RELEASE_VERSION}" --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes-file release-notes.md -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap
|
||||
curl -s http://129.146.42.180/api/v1/github/sync/stable
|
||||
fi;
|
||||
|
||||
|
|
9
.github/workflows/build-macos.yml
vendored
9
.github/workflows/build-macos.yml
vendored
|
@ -49,7 +49,6 @@ jobs:
|
|||
GH_REQUEST_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
run: |
|
||||
sudo chmod +x resources/version.sh && ./resources/version.sh || true
|
||||
echo "APP_VERSION=$(node -p -e 'require("./package.json").version')" >>$GITHUB_ENV
|
||||
|
||||
- name: Clear node_airtunes2 cache
|
||||
run: rm -rf ~/Library/pnpm/store/v3/tmp/cf5bc2de2629636ca224995234b8eaa1 || true
|
||||
|
@ -91,7 +90,7 @@ jobs:
|
|||
repo_name: ciderapp/cider-releases
|
||||
repo_token: ${{ secrets.RELEASE_TOKEN }}
|
||||
file: dist/latest-mac.yml
|
||||
tag: v${{ env.APP_VERSION }}
|
||||
tag: v${{ env.RELEASE_VERSION }}
|
||||
|
||||
- name: Import
|
||||
uses: apple-actions/import-codesign-certs@v1
|
||||
|
@ -114,7 +113,7 @@ jobs:
|
|||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v2.2.3
|
||||
with:
|
||||
name: Cider-macOS-${{ env.APP_VERSION }}
|
||||
name: Cider-macOS-${{ env.RELEASE_VERSION }}
|
||||
path: |
|
||||
dist/*.dmg
|
||||
dist/*.pkg
|
||||
|
@ -126,7 +125,7 @@ jobs:
|
|||
repo_name: ciderapp/cider-releases
|
||||
repo_token: ${{ secrets.RELEASE_TOKEN }}
|
||||
file: dist/Cider-*-universal.dmg
|
||||
tag: v${{ env.APP_VERSION }}
|
||||
tag: v${{ env.RELEASE_VERSION }}
|
||||
|
||||
- name: Upload Files (PKG)
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
|
@ -134,7 +133,7 @@ jobs:
|
|||
repo_name: ciderapp/cider-releases
|
||||
repo_token: ${{ secrets.RELEASE_TOKEN }}
|
||||
file: dist/Cider-*-universal.pkg
|
||||
tag: v${{ env.APP_VERSION }}
|
||||
tag: v${{ env.RELEASE_VERSION }}
|
||||
- name: Trigger Bot Sync (main)
|
||||
uses: indiesdev/curl@v1.1
|
||||
with:
|
||||
|
|
|
@ -9,25 +9,37 @@ 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)
|
||||
if [[ $GH_RELEASE_REQUEST != "" ]]; then
|
||||
COMMIT_SINCE_STABLE=$(printf "%03d\n" $(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE"))
|
||||
else
|
||||
COMMIT_SINCE_STABLE=$(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE")
|
||||
fi
|
||||
VERSION_POSTFIX=$(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE")
|
||||
VERSION_POSTFIX_NUMBERED=$(printf "%03d\n" $VERSION_POSTFIX)
|
||||
CURRENT_VERSION=$(node -p -e "require('./package.json').version")
|
||||
|
||||
# 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 && $(node -p -e "require('./package.json').version" | cut -d '.' -f 4) != $VERSION_POSTFIX ]]; then
|
||||
APP_VERSION_NUMBERED="$CURRENT_VERSION.$VERSION_POSTFIX_NUMBERED"
|
||||
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 == "" ]]; 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
|
||||
APP_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=$APP_VERSION_NUMBERED" >>$GITHUB_ENV
|
||||
else
|
||||
echo "export APP_VERSION=$NEW_VERSION" >>$BASH_ENV
|
||||
echo "export RELEASE_VERSION=$APP_VERSION_NUMBERED" >>$BASH_ENV
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue