Tag-based release process (#4530)
* WIP: Improve current nightly implementation * Add nightly icons * Clean up script * Clean up * Clean up * Clean up2 * Clean up3 * WIP: Make the release process non-blocking First commit to fix #4522 * Quick fix * Test release and updater-test * Try nightly build * WIP nightly tag creation * Change of direction * Quick fix * Test nightly * Better release notes for nightly * Migrate to artifact@v4 and prepare publish release * Fix out-yml for artifact@v4 * Progress towards publish-release * merge-multiple: true * Add dependency * Clean up. Change direction again on updater-test (now with RELEASE workflow) * Clean up and test release builds * Fix name * Clean up, add README * Add release notes override, another release test * Fake release version & better draft release * Test nightly * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * Clean up and first attempt at publish-release-apps * Add GH_TOKEN * Add github-token to download-artifact step * Add github-token to all download-artifact steps * Add checkout and node steps * Clean up * Remove whitespace * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * Quick typo * Add Kevin's semantic-release.sh script to replace make-release.sh --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,13 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
export VERSION=$(date +'%-y.%-m.%-d')
|
||||
export COMMIT=$(git rev-parse --short HEAD)
|
||||
|
||||
# package.json
|
||||
VERSION=$(date +'%-y.%-m.%-d') yarn files:set-version
|
||||
yarn files:set-version
|
||||
echo "$(jq --arg name 'Zoo Modeling App (Nightly)' '.productName=$name' package.json --indent 2)" > package.json
|
||||
|
||||
# electron-builder.yml
|
||||
yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/nightly"' electron-builder.yml
|
||||
yq -i '.appId = "dev.zoo.modeling-app-nightly"' electron-builder.yml
|
||||
|
||||
# Release notes
|
||||
echo "Nightly build $VERSION (commit $COMMIT)" > release-notes.md
|
||||
|
||||
# icons
|
||||
cp assets/icon-nightly.png assets/icon.png
|
||||
cp assets/icon-nightly.ico assets/icon.ico
|
||||
|
||||
43
scripts/semantic-release.sh
Executable file
43
scripts/semantic-release.sh
Executable file
@ -0,0 +1,43 @@
|
||||
# Requires access to an environment variable GH_TOKEN
|
||||
# If you are in the path of the git repository the gh release list will automatically point to that git repo
|
||||
# aka cd /some/path/modeling-app
|
||||
# $ gh release list
|
||||
# Get the latest semver tag from git
|
||||
latest_tag=$(gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name')
|
||||
|
||||
# Function to bump version numbers
|
||||
bump_version() {
|
||||
local version=$1
|
||||
local bump_type=$2
|
||||
local major=$(echo $version | cut -d '.' -f 1 | sed 's/v//')
|
||||
local minor=$(echo $version | cut -d '.' -f 2)
|
||||
local patch=$(echo $version | cut -d '.' -f 3)
|
||||
|
||||
case "$bump_type" in
|
||||
major)
|
||||
major=$((major + 1))
|
||||
minor=0
|
||||
patch=0
|
||||
;;
|
||||
minor)
|
||||
minor=$((minor + 1))
|
||||
patch=0
|
||||
;;
|
||||
*)
|
||||
patch=$((patch + 1))
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "v${major}.${minor}.${patch}"
|
||||
}
|
||||
|
||||
# Determine the type of bump based on the argument
|
||||
bump_type=${1:-minor}
|
||||
|
||||
# Bump the version
|
||||
new_version=$(bump_version $latest_tag $bump_type)
|
||||
|
||||
# Print the new semver tag
|
||||
# Example output v0.27.1
|
||||
# Yes it will include the v at the start
|
||||
echo $new_version
|
||||
9
scripts/set-files-notes.sh
Executable file
9
scripts/set-files-notes.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
yq -i '.releaseNotes = strenv(NOTES)' out/latest-linux-arm64.yml
|
||||
yq -i '.releaseNotes = strenv(NOTES)' out/latest-linux.yml
|
||||
yq -i '.releaseNotes = strenv(NOTES)' out/latest-mac.yml
|
||||
yq -i '.releaseNotes = strenv(NOTES)' out/latest.yml
|
||||
|
||||
NEW_JSON=`jq --arg n "$NOTES" '.notes=$n' out/last_download.json --indent 2`
|
||||
echo "$NEW_JSON" > out/last_download.json
|
||||
Reference in New Issue
Block a user