-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically release a new version of flyctl daily (#3626)
* Automatically release a new version of flyctl daily * Only run monday through thursday * Added some info about automatic releases to the README * Eastern Standard Time Not Eastern time (daylight savings not included)
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Automatically release a new version of flyctl | ||
|
||
on: | ||
schedule: | ||
- cron: '0 20 * * MON-THU' # Runs at 3 PM Eastern Standard Time Monday Through Thursday (8 PM UTC) | ||
|
||
jobs: | ||
run_script: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout master branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: master | ||
- name: bump version | ||
run: | | ||
./scripts/force_bump_version.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
ORIGIN=${ORIGIN:-origin} | ||
|
||
bump=${1:-patch} | ||
|
||
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
previous_version="$("$dir"/../scripts/version.sh -s)" | ||
|
||
prerelversion=$("$dir"/../scripts/semver get prerel "$previous_version") | ||
if [[ $prerelversion == "" ]]; then | ||
new_version=$("$dir"/../scripts/semver bump "$bump" "$previous_version") | ||
else | ||
new_version=${previous_version//-$prerelversion/} | ||
fi | ||
|
||
new_version="v$new_version" | ||
|
||
echo "Bumping version from v${previous_version} to ${new_version}" | ||
|
||
git tag -m "release ${new_version}" -a "$new_version" && git push "${ORIGIN}" tag "$new_version" |