Skip to content
Merged
Show file tree
Hide file tree
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
39 changes: 35 additions & 4 deletions .github/workflows/update-wfctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ on:

permissions:
contents: write
pull-requests: write

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Update wfctl formula
env:
VERSION: ${{ github.event.client_payload.version }}
run: |
set -euo pipefail

# Strip v prefix for formula version
FORMULA_VERSION="${VERSION#v}"

Comment on lines +21 to 25
Expand All @@ -29,6 +32,10 @@ jobs:
SHA_DARWIN_ARM64=$(grep "wfctl-darwin-arm64$" checksums.txt | awk '{print $1}')
SHA_LINUX_AMD64=$(grep "wfctl-linux-amd64$" checksums.txt | awk '{print $1}')
SHA_LINUX_ARM64=$(grep "wfctl-linux-arm64$" checksums.txt | awk '{print $1}')
test -n "$SHA_DARWIN_AMD64"
test -n "$SHA_DARWIN_ARM64"
test -n "$SHA_LINUX_AMD64"
test -n "$SHA_LINUX_ARM64"

# Generate the formula
cat > Formula/wfctl.rb << RUBY
Expand Down Expand Up @@ -81,11 +88,35 @@ jobs:
# Remove leading whitespace from heredoc
sed -i 's/^ //' Formula/wfctl.rb

- name: Commit and push
- name: Open update pull request
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ github.event.client_payload.version }}
run: |
set -euo pipefail

BRANCH="automation/update-wfctl-${VERSION}"
Comment on lines +96 to +98
git config user.name "goreleaserbot"
git config user.email "bot@goreleaser.com"
git checkout -B "$BRANCH"
git add Formula/wfctl.rb
git diff --cached --quiet && echo "No changes" && exit 0
git commit -m "chore: update wfctl to ${{ github.event.client_payload.version }}"
git push
git commit -m "chore: update wfctl to ${VERSION}"
git push --force-with-lease --set-upstream origin "$BRANCH"
Comment on lines +101 to +105

BODY="Automated wfctl Homebrew formula update for ${VERSION}."
if PR_NUMBER=$(gh pr view "$BRANCH" --json number --jq .number 2>/dev/null); then
gh pr edit "$PR_NUMBER" \
--title "chore: update wfctl to ${VERSION}" \
--body "$BODY"
else
PR_URL=$(gh pr create \
--base main \
--head "$BRANCH" \
--title "chore: update wfctl to ${VERSION}" \
--body "$BODY")
PR_NUMBER="${PR_URL##*/}"
fi

gh pr merge "$PR_NUMBER" --auto --squash --delete-branch || \
echo "Auto-merge unavailable; update PR ${PR_NUMBER} remains open."
10 changes: 5 additions & 5 deletions Formula/wfctl.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
class Wfctl < Formula
desc "CLI for the workflow orchestration engine — validate, inspect, deploy, and manage configs"
homepage "https://github.com/GoCodeAlone/workflow"
version "0.60.17"
version "0.75.1"
license "Apache-2.0"

on_macos do
on_intel do
url "https://github.com/GoCodeAlone/workflow/releases/download/v#{version}/wfctl-darwin-amd64"
sha256 "3aafa03d7a41d210475f40a7c2971a589eba590d3f76ffe8950eb25402d7bcc5"
sha256 "ad44de779107cf505eb96f8520521ad290499adad0fb7db87f43caf00562dba1"
end
on_arm do
url "https://github.com/GoCodeAlone/workflow/releases/download/v#{version}/wfctl-darwin-arm64"
sha256 "4203f41244d0ff6e22e580a4452e044555da4e39181be4cdbb453e47b19aa8cf"
sha256 "fac0867b892aa5c33a8656f1fdff7979310e598b10d04550339fb4fd5f5821f6"
end
end

on_linux do
on_intel do
url "https://github.com/GoCodeAlone/workflow/releases/download/v#{version}/wfctl-linux-amd64"
sha256 "fefba2dd3a93ad8f8587a9a198cb2d7189002efe859949c450b010103d0933bf"
sha256 "2a8656410969d32c476151de1d27f6e334466a357db94c4fcc8be9bf493da0ea"
end
on_arm do
url "https://github.com/GoCodeAlone/workflow/releases/download/v#{version}/wfctl-linux-arm64"
sha256 "ca07453c1005700c6bf124ea1acdb62bcfb77a176e7c022f71975a8886339d2d"
sha256 "5782e9d94d318441b5fc34d744e02c03bca5b54908f547dcca08f9e00c46bf78"
end
end

Expand Down