Skip to content

Commit

Permalink
Automatically release a new version of flyctl daily (#3626)
Browse files Browse the repository at this point in the history
* 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
billyb2 committed Jun 13, 2024
1 parent 4d13975 commit c63420c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/auto-release.yml
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ app: banana

`flyctl` will operate against the `banana` app unless overridden by the -a flag or other app name setting in the command line.

## Releases
`flyctl` is automatically released at 3 PM Eastern Standard Time Monday - Thursday. If needed, you can bump a release by running `./scripts/bump_version.sh`.

## Building on Windows

There is a simple Powershell script, `winbuild.ps1`, which will run the code generation for the help files, format them, and run a full build, leaving a new binary in the bin directory.
Expand Down
24 changes: 24 additions & 0 deletions scripts/force_bump_version.sh
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"

0 comments on commit c63420c

Please sign in to comment.