Skip to content
6 changes: 2 additions & 4 deletions .github/workflows/gh-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:

jobs:
build:
runs-on:
group: gusto-ubuntu-default
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -41,8 +40,7 @@ jobs:

if: ${{ github.ref_type == 'tag' || github.ref == 'refs/heads/main' }}
# Specify runner + deployment step
runs-on:
group: gusto-ubuntu-default
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
63 changes: 40 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:
jobs:
prepare-release:
name: Prepare Release
runs-on:
group: gusto-ubuntu-default
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
Expand All @@ -19,22 +18,41 @@ jobs:
with:
fetch-depth: 0

- name: Setup git user
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- name: Calculate version
id: version
run: |
VERSION=$(date -u +%Y.%m.%d.%H%M)
# CalVer: YEAR.MONTH.DAY+HHMM — e.g., 2026.4.7+1823
# The +HHMM build metadata ensures uniqueness for multiple same-day
# releases. Per semver, build metadata is ignored for version
# comparison (2026.4.7+0900 == 2026.4.7+1400), but that's fine
# since this package isn't published to crates.io — the version
# only appears in the compiled binary and git tags.
VERSION="$(date -u +%-Y.%-m.%-d+%H%M)"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Version: ${VERSION}"

push-release:
name: Push Release Branch and Tag
needs: prepare-release
runs-on:
group: gusto-ubuntu-default
outputs:
version: ${{ needs.prepare-release.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup git user
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- name: Merge to release branch and tag
run: |
set -euo pipefail
VERSION="${{ steps.version.outputs.version }}"
VERSION="${{ needs.prepare-release.outputs.version }}"

# Checkout or create release branch
if git fetch origin release:release 2>/dev/null; then
Expand All @@ -44,14 +62,14 @@ jobs:
fi

# Merge main into release (no commit yet)
git merge main --no-commit --no-ff
git merge origin/main --no-commit --no-ff || true

# Update version in Cargo.toml
sed -i 's/^version = "0.0.0-dev"/version = "'"${VERSION}"'"/' Cargo.toml
# Update version in Cargo.toml (replace any existing version)
sed -i 's/^version = ".*"/version = "'"${VERSION}"'"/' Cargo.toml
grep -q "^version = \"${VERSION}\"" Cargo.toml || { echo "Version update failed"; exit 1; }

# Commit merge with version bump
git add Cargo.toml
# Commit release with version bump
git add -A
git commit -m "Release v${VERSION}"

# Create tag
Expand All @@ -63,24 +81,23 @@ jobs:

build:
name: Build ${{ matrix.target }}
needs: prepare-release
runs-on:
group: ${{ matrix.runner }}
needs: push-release
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
runner: gusto-osx-default
runner: macos-latest
use-cross: false
- target: x86_64-unknown-linux-gnu
runner: gusto-ubuntu-default
runner: ubuntu-latest
use-cross: true
- target: x86_64-unknown-linux-musl
runner: gusto-ubuntu-default
runner: ubuntu-latest
use-cross: true
- target: aarch64-unknown-linux-gnu
runner: gusto-ubuntu-default
runner: ubuntu-latest
use-cross: true
steps:
- name: Checkout release branch
Expand Down Expand Up @@ -123,7 +140,7 @@ jobs:

release:
name: Create GitHub Release
needs: [prepare-release, build]
needs: [push-release, build]
runs-on:
group: gusto-ubuntu-default
steps:
Expand All @@ -139,7 +156,7 @@ jobs:
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
VERSION="${{ needs.prepare-release.outputs.version }}"
VERSION="${{ needs.push-release.outputs.version }}"
gh release create "v${VERSION}" \
--title "v${VERSION}" \
--notes "" \
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ on:
jobs:
tests:
name: Run Tests
runs-on:
group: gusto-ubuntu-default
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update
Expand Down
Loading