@@ -279,61 +279,14 @@ jobs:
279279
280280 gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
281281
282- publish-homebrew-formula :
283- needs :
284- - plan
285- - host
286- runs-on : " ubuntu-22.04"
287- env :
288- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
289- PLAN : ${{ needs.plan.outputs.val }}
290- GITHUB_USER : " axo bot"
291- GITHUB_EMAIL : " admin+bot@axo.dev"
292- if : ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
293- steps :
294- - uses : actions/checkout@v4
295- with :
296- persist-credentials : false
297- repository : " shellrow/homebrew-tap-chmod-bpf"
298- token : ${{ secrets.HOMEBREW_TAP_TOKEN }}
299- # So we have access to the formula
300- - name : Fetch homebrew formulae
301- uses : actions/download-artifact@v4
302- with :
303- pattern : artifacts-*
304- path : Formula/
305- merge-multiple : true
306- # This is extra complex because you can make your Formula name not match your app name
307- # so we need to find releases with a *.rb file, and publish with that filename.
308- - name : Commit formula files
309- run : |
310- git config --global user.name "${GITHUB_USER}"
311- git config --global user.email "${GITHUB_EMAIL}"
312-
313- for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
314- filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
315- name=$(echo "$filename" | sed "s/\.rb$//")
316- version=$(echo "$release" | jq .app_version --raw-output)
317-
318- export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
319- brew update
320- # We avoid reformatting user-provided data such as the app description and homepage.
321- brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
322-
323- git add "Formula/${filename}"
324- git commit -m "${name} ${version}"
325- done
326- git push
327-
328282 announce :
329283 needs :
330284 - plan
331285 - host
332- - publish-homebrew-formula
333286 # use "always() && ..." to allow us to wait for all publish jobs while
334287 # still allowing individual publish jobs to skip themselves (for prereleases).
335288 # "host" however must run to completion, no skipping allowed!
336- if : ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
289+ if : ${{ always() && needs.host.result == 'success' }}
337290 runs-on : " ubuntu-22.04"
338291 env :
339292 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments