-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.49 KB
/
release_homebrew_tap.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Release Homebrew tap
on:
release:
types:
- released
permissions:
contents: read
jobs:
update-homebrew-salami:
name: Update Homebrew Tap
runs-on: ubuntu-latest
steps:
- name: Checkout Salami repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.target_commitish }}
path: salami
- name: Checkout Salami homebrew repo
uses: actions/checkout@v3
with:
repository: petrgazarov/homebrew-salami
path: homebrew-salami
token: ${{ secrets.HOMEBREW_SALAMI_GITHUB_TOKEN }}
- name: Update Homebrew Tap
run: |
set -euo pipefail
# Can simulate this by cloning petrgazarov/salami & petrgazarov/homebrew-salami to adacent directories
# and running from their parent:
./salami/.github/scripts/generate-homebrew-tap.sh "${{ github.ref }}" > ./homebrew-salami/salami.rb
- name: Commit updated formula
working-directory: homebrew-salami
run: |
set -euo pipefail
git config user.name petrgazarov
git config user.email [email protected]
git add salami.rb
echo "::group::git diff"
git --no-pager diff
echo "::endgroup::"
git commit -m "Brew formula update for Salami version ${{ github.ref }}"
- name: Push formula
working-directory: homebrew-salami
run: |
set -euo pipefail
git push origin HEAD:main