Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,42 @@ jobs:
env:
GH_TOKEN: ${{ secrets.TAP_TOKEN }}
TAG: ${{ needs.prepare.outputs.tag }}
SHA: ${{ needs.build-macos.outputs.sha256 }}
run: |
gh workflow run bump.yml --repo NoiXdev/homebrew-tap \
-f kind=cask \
-f name=printy \
-f version="${TAG#v}" \
-f sha256="${{ needs.build-macos.outputs.sha256 }}"
set -uo pipefail
for attempt in 1 2 3; do
if gh workflow run bump.yml --repo NoiXdev/homebrew-tap \
-f kind=cask \
-f name=printy \
-f version="${TAG#v}" \
-f sha256="$SHA"; then
echo "Dispatched on attempt $attempt."
exit 0
fi
echo "Dispatch attempt $attempt failed."
sleep 10
done
exit 1

# This job runs after the release is already public. A silent failure
# here leaves the tap pointing at the previous version while the
# README advertises this one, so say exactly what to run by hand.
- name: Explain how to finish the bump by hand
if: failure()
env:
TAG: ${{ needs.prepare.outputs.tag }}
SHA: ${{ needs.build-macos.outputs.sha256 }}
run: |
echo "::error::The Homebrew cask was NOT bumped, but ${TAG} is already published."
echo "::error::Until this is run, 'brew install --cask printy' installs the previous version."
echo "Run it by hand with a token that may dispatch workflows in the tap:"
echo ""
echo " gh workflow run bump.yml --repo NoiXdev/homebrew-tap \\"
echo " -f kind=cask -f name=printy \\"
echo " -f version=${TAG#v} -f sha256=${SHA}"
echo ""
echo "A 403 here means TAP_TOKEN cannot dispatch in NoiXdev/homebrew-tap."
echo "See SETUP.md in that repository for what the token needs."

announce:
name: Announce the release
Expand Down
Loading