forked from mas-cli/mas
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (63 loc) · 2.1 KB
/
release-published.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# .github/workflows/release-published.yml
#
---
name: release-published
on:
release:
types: [published]
permissions:
actions: read
contents: write
pull-requests: write
defaults:
run:
# Force all run commands to not use Rosetta 2
shell: arch -arm64 /bin/zsh -Negku {0}
jobs:
release-published:
if: ${{!github.event.repository.fork}}
runs-on: macos-15
steps:
- name: 🛒 Checkout repo
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: init.defaultBranch
GIT_CONFIG_VALUE_0: ${{github.event.repository.default_branch}}
uses: actions/checkout@v4
with:
# Include all history & tags for script/version
fetch-depth: 0
- name: 🔧 Setup repo
run: script/setup_workflow_repo
- name: 🚰 Apply pr-pull label to custom tap formula bump PR
env:
TOKEN_APP_ID: ${{secrets.TOKEN_APP_ID}}
TOKEN_APP_INSTALLATION_ID: ${{secrets.TOKEN_APP_INSTALLATION_ID}}
TOKEN_APP_PRIVATE_KEY: ${{secrets.TOKEN_APP_PRIVATE_KEY}}
run: |
export GH_TOKEN="$(script/generate_token)"
unsetopt errexit
bump_url="$(gh release -R "${GITHUB_REPOSITORY}" download "${GITHUB_REF_NAME}" -p bump.url -O - 2>/dev/null)"
found_bump_url="${?}"
setopt errexit
if [[ "${found_bump_url}" -eq 0 ]]; then
[[ -n "${bump_url}" ]] && gh pr edit "${bump_url}" --add-label pr-pull
gh release -R "${GITHUB_REPOSITORY}" delete-asset "${GITHUB_REF_NAME}" bump.url -y
else
printf $'No custom tap formula bump PR URL found for tag\'%s\'\n' "${GITHUB_REF_NAME}"
fi
- name: 🍺 Bump homebrew-core formula
if: ${{!github.event.release.prerelease}}
env:
HOMEBREW_GITHUB_API_TOKEN: ${{github.token}}
run: |
brew bump-formula-pr\
--tag "${GITHUB_REF_NAME}"\
--revision "${GITHUB_SHA}"\
--fork-org "${GITHUB_REPOSITORY_OWNER}"\
--no-browse\
--online\
--strict\
--verbose\
mas