mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
Add bump-homebrew-formula.yml: on a stable release it downloads the published amy-<version>-jvm.tar.gz bundle, computes its sha256, and opens a PR syncing cli/packaging/homebrew/amy.rb's url + sha256 — automating the manual step the formula header calls out and keeping the reference formula ready for the homebrew-core submission. The homebrew-core auto-bump is deferred (documented TODO) because brew bump-formula-pr can only bump a formula already in the tap, and amy has not been submitted to homebrew-core yet. Also fix the "Report failure" step in bump-homebrew.yml and bump-winget.yml: both declared `permissions: contents: read`, but github.rest.issues.create needs issues:write, so the failure reporter itself 403'd and never filed an alert. Add issues:write to both. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TGdEUziwC3Uc3XhB7DFQYt
76 lines
2.9 KiB
YAML
76 lines
2.9 KiB
YAML
name: Bump Homebrew Cask
|
|
|
|
# Fires when a GH Release is published (not draft, not prerelease).
|
|
# `release.types: [released]` event fires only for stable releases — still
|
|
# double-checked by .github/actions/assert-stable-release for defense-in-depth.
|
|
on:
|
|
release:
|
|
types: [released]
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Release tag to bump (for manual recovery)'
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: read
|
|
# The "Report failure" step below opens a [release-ops] issue via
|
|
# github.rest.issues.create; that needs issues:write. Without it the failure
|
|
# reporter itself 403s and no alert is ever filed.
|
|
issues: write
|
|
|
|
concurrency:
|
|
# Serialize bumps per tag; do not cancel in-progress bumps.
|
|
group: bump-homebrew-${{ github.event.release.tag_name || inputs.tag }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
bump:
|
|
if: github.event_name == 'workflow_dispatch' || github.event.release.prerelease == false
|
|
runs-on: ubuntu-latest # brew runs on Linux — saves macOS runner quota
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Re-assert stable release
|
|
uses: ./.github/actions/assert-stable-release
|
|
with:
|
|
tag: ${{ github.event.release.tag_name || inputs.tag }}
|
|
is_prerelease: ${{ github.event.release.prerelease || 'false' }}
|
|
is_draft: ${{ github.event.release.draft || 'false' }}
|
|
|
|
- name: Bump cask (push-or-update PR)
|
|
uses: macauley/action-homebrew-bump-cask@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
|
|
with:
|
|
token: ${{ secrets.HOMEBREW_TOKEN }}
|
|
tap: homebrew/cask
|
|
cask: amethyst-nostr
|
|
tag: ${{ github.event.release.tag_name || inputs.tag }}
|
|
|
|
- name: Report failure
|
|
if: failure()
|
|
uses: actions/github-script@v9
|
|
with:
|
|
script: |
|
|
const tag = context.payload.release?.tag_name || context.payload.inputs?.tag || 'unknown';
|
|
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
|
|
await github.rest.issues.create({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
title: `[release-ops] bump-homebrew failed for ${tag}`,
|
|
body: [
|
|
`Homebrew cask bump failed for release \`${tag}\`.`,
|
|
``,
|
|
`- Run: ${runUrl}`,
|
|
`- Channel: Homebrew Cask (\`amethyst-nostr\`)`,
|
|
``,
|
|
`Recovery options:`,
|
|
`1. Re-run the workflow once underlying issue is fixed`,
|
|
`2. Manually run \`brew bump-cask-pr amethyst-nostr --version ${tag.replace(/^v/, '')}\``,
|
|
`3. File PR directly against Homebrew/homebrew-cask`
|
|
].join('\n'),
|
|
labels: ['release-ops', 'bug']
|
|
});
|