Release #9
Workflow file for this run
This file contains hidden or 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
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| ci-gate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check CI status for tagged commit | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| echo "Checking CI checks for ${{ github.sha }}..." | |
| max_attempts=5 | |
| attempt=0 | |
| response="" | |
| while [ "$attempt" -lt "$max_attempts" ]; do | |
| attempt=$((attempt + 1)) | |
| response=$(gh api "/repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs") | |
| total=$(echo "$response" | jq '.total_count') | |
| if [ "$total" -gt 0 ]; then | |
| break | |
| fi | |
| if [ "$attempt" -ge "$max_attempts" ]; then | |
| echo "FAIL: no GitHub check-runs found for ${{ github.sha }} after $max_attempts attempts" | |
| exit 1 | |
| fi | |
| echo "Waiting for check-runs to propagate (attempt $attempt/$max_attempts)..." | |
| sleep 15 | |
| done | |
| result=$(echo "$response" | jq -r \ | |
| '.check_runs[] | select(.name != "Release") | {name: .name, conclusion: .conclusion}') | |
| failed=$(echo "$result" | jq -r \ | |
| 'select(.conclusion == "failure" or .conclusion == "timed_out" or | |
| .conclusion == "cancelled" or .conclusion == "action_required") | .name') | |
| if [ -n "$failed" ]; then | |
| echo "FAIL: the following checks did not pass:" | |
| echo "$failed" | |
| exit 1 | |
| fi | |
| echo "OK: all required checks passed" | |
| release: | |
| needs: [ci-gate] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Verify VERSION matches tag | |
| run: | | |
| tag="${GITHUB_REF#refs/tags/v}" | |
| ver=$(cat VERSION) | |
| if [ "$tag" != "$ver" ]; then | |
| echo "Tag ($tag) does not match VERSION ($ver)"; exit 1 | |
| fi | |
| - name: Marketplace version check | |
| run: | | |
| ver=$(cat VERSION) | |
| mkt_ver=$(jq -r '.plugins[0].version // empty' .claude-plugin/marketplace.json) | |
| plg_ver=$(jq -r '.version // empty' .claude-plugin/plugin.json) | |
| rc=0 | |
| [ "$mkt_ver" = "$ver" ] || { echo "FAIL: marketplace.json version ($mkt_ver) != VERSION ($ver)"; rc=1; } | |
| [ "$plg_ver" = "$ver" ] || { echo "FAIL: plugin.json version ($plg_ver) != VERSION ($ver)"; rc=1; } | |
| [ "$rc" -eq 0 ] && echo "OK: all version fields match $ver" | |
| exit "$rc" | |
| - name: Extract CHANGELOG entry | |
| run: | | |
| tag="${GITHUB_REF#refs/tags/v}" | |
| awk -v ver="$tag" ' | |
| $0 ~ "^## \\[" ver "\\]" { capture=1; next } | |
| capture && /^## \[/ { exit } | |
| capture { print } | |
| ' CHANGELOG.md > release-notes.md | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: release-notes.md | |
| draft: false | |
| prerelease: false | |
| docker: | |
| needs: [release] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker daemon (containerd snapshotter) | |
| uses: docker/setup-docker-action@v4 | |
| with: | |
| daemon-config: | | |
| { | |
| "features": { | |
| "containerd-snapshotter": true | |
| } | |
| } | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ghcr.io/mohandoz/conjure:${{ github.ref_name }} | |
| ghcr.io/mohandoz/conjure:latest | |
| homebrew: | |
| needs: [release] | |
| runs-on: ubuntu-latest | |
| env: | |
| COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
| steps: | |
| - name: Preflight — verify HOMEBREW_TAP_GITHUB_TOKEN is set | |
| run: | | |
| if [ -z "$COMMITTER_TOKEN" ]; then | |
| echo "SKIP: HOMEBREW_TAP_GITHUB_TOKEN secret not configured" | |
| echo "Set the secret to enable automatic Homebrew formula bumps" | |
| exit 0 | |
| fi | |
| echo "OK: HOMEBREW_TAP_GITHUB_TOKEN present" | |
| - name: Bump Homebrew formula | |
| if: ${{ env.COMMITTER_TOKEN != '' }} | |
| uses: mislav/bump-homebrew-formula-action@v3 | |
| with: | |
| formula-name: conjure | |
| homebrew-tap: mohandoz/homebrew-conjure | |
| download-url: https://github.com/mohandoz/conjure/archive/refs/tags/${{ github.ref_name }}.tar.gz | |
| env: | |
| COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} |