goose/.github/workflows/canary.yml
dependabot[bot] c525364c33
chore(deps): bump actions/checkout from 7.0.0 to 7.0.1 (#10673)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-29 09:52:26 -04:00

181 lines
5.6 KiB
YAML

# This workflow is for canary releases, automatically triggered by push to main
# This workflow is identical to "release.yml" with these exceptions:
# - Triggered by push to main
# - GitHub Release tagged as "canary"
on:
push:
paths-ignore:
- "documentation/**"
branches:
- main
name: Canary
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# ------------------------------------
# 1) Prepare Version
# ------------------------------------
prepare-version:
name: Prepare Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
# checkout code so we can read the Cargo.toml
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Generate a canary version
id: set-version
run: |
# Extract the version from Cargo.toml
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
VERSION=$(grep '^version\s*=' Cargo.toml | head -n 1 | cut -d\" -f2)
VERSION="${VERSION}-canary+${SHORT_SHA}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
# ------------------------------------
# 2) Build CLI targets not produced by desktop workflows
# ------------------------------------
build-cli-linux:
needs: [prepare-version]
uses: ./.github/workflows/build-cli-linux.yml
with:
version: ${{ needs.prepare-version.outputs.version }}
# ------------------------------------
# 3) Upload Install CLI Script (we only need to do this once)
# ------------------------------------
install-script:
name: Upload Install Script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: download_cli.sh
path: download_cli.sh
# ------------------------------------------------------------
# 4) Bundle CLI and Desktop (macOS ARM64)
# ------------------------------------------------------------
bundle-macos-arm64:
needs: [prepare-version]
uses: ./.github/workflows/bundle-macos.yml
permissions:
contents: read
with:
version: ${{ needs.prepare-version.outputs.version }}
target: aarch64-apple-darwin
package_cli: true
package_desktop: true
signing: false
# ------------------------------------------------------------
# 5) Bundle CLI and Desktop (macOS x64)
# ------------------------------------------------------------
bundle-macos-x64:
needs: [prepare-version]
uses: ./.github/workflows/bundle-macos.yml
permissions:
contents: read
with:
version: ${{ needs.prepare-version.outputs.version }}
target: x86_64-apple-darwin
package_cli: true
package_desktop: true
signing: false
# ------------------------------------------------------------
# 6) Bundle Desktop App (Linux)
# ------------------------------------------------------------
bundle-desktop-linux:
needs: [prepare-version]
uses: ./.github/workflows/bundle-desktop-linux.yml
with:
version: ${{ needs.prepare-version.outputs.version }}
# ------------------------------------------------------------
# 7) Bundle CLI and Desktop (Windows)
# ------------------------------------------------------------
bundle-windows:
needs: [prepare-version]
uses: ./.github/workflows/bundle-windows.yml
permissions:
contents: read
id-token: write
with:
version: ${{ needs.prepare-version.outputs.version }}
package_cli: true
package_desktop: true
signing: false
bundle-windows-cuda:
needs: [prepare-version]
uses: ./.github/workflows/bundle-windows.yml
permissions:
contents: read
id-token: write
with:
version: ${{ needs.prepare-version.outputs.version }}
package_cli: true
package_desktop: true
signing: false
windows_variant: cuda
# ------------------------------------
# 8) Create/Update GitHub Release
# ------------------------------------
release:
name: Release
runs-on: ubuntu-latest
needs: [build-cli-linux, install-script, bundle-macos-arm64, bundle-macos-x64, bundle-desktop-linux, bundle-windows, bundle-windows-cuda]
permissions:
contents: write
id-token: write # Required for Sigstore OIDC signing
attestations: write # Required for SLSA build provenance attestations
steps:
- name: Download release artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: '!internal-*'
merge-multiple: true
- name: Attest build provenance
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
with:
subject-path: |
goose-*.tar.bz2
goose-*.tar.gz
goose-*.zip
Goose*.zip
*.deb
*.rpm
*.flatpak
download_cli.sh
# Create/update the canary release
- name: Release canary
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
tag: canary
name: Canary
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: |
goose-*.tar.bz2
goose-*.tar.gz
goose-*.zip
Goose*.zip
*.deb
*.rpm
*.flatpak
download_cli.sh
allowUpdates: true
omitBody: true
omitPrereleaseDuringUpdate: true