-
Notifications
You must be signed in to change notification settings - Fork 21
58 lines (47 loc) · 1.72 KB
/
publish.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
name: brew pr-pull
on:
pull_request_target:
types:
- labeled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.OSX_CROSS_ARM_HOMEBREW_GITHUB_API_TOKEN }}
PULL_REQUEST: ${{ github.event.pull_request.number }}
BRANCH: ${{ github.event.pull_request.head.ref }}
jobs:
pr-pull:
if: contains(github.event.pull_request.labels.*.name, 'pr-pull')
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: "${{ secrets.OSX_CROSS_ARM_HOMEBREW_GITHUB_API_TOKEN }}"
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v1
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems
- name: Set up git
run: |
git config --global user.name "osxCrossTestBot"
git config --global user.email "[email protected]"
- name: Pull bottles
run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST
- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ secrets.OSX_CROSS_ARM_HOMEBREW_GITHUB_API_TOKEN }}
branch: master
- name: Delete branch
if: github.event.pull_request.head.repo.fork == false
run: git push --delete origin $BRANCH