This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (79 loc) · 2.49 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Publish Bottles
on:
pull_request:
paths:
- Formula/phylum.rb
jobs:
build-bottles:
strategy:
matrix:
os:
- macos-12
- macos-13
include:
- os: [self-hosted, macos, arm64]
self_hosted: true
runs-on: ${{ matrix.os }}
steps:
- name: Set environment
if: ${{ matrix.self_hosted }}
# This environment variable is not documented, but is needed to
# prevent failures and destructive actions added in this commit:
# https://github.com/Homebrew/actions/commit/616a563beaa0715ddebbb39a331224af1b46fdaa
run: echo "GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED=1" >> "$GITHUB_ENV"
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
debug: true
- run: brew update
- run: brew uninstall -f phylum || true
- run: brew install --no-binaries --include-test --build-bottle phylum
- run: brew test phylum
- name: brew bottle
run: |
VERSION=$(brew list --versions phylum | cut "-d " -f2)
brew bottle --json --root-url "https://github.com/phylum-dev/homebrew-cli/releases/download/phylum-$VERSION" phylum
- name: Upload bottles as artifact
uses: actions/upload-artifact@v3
with:
name: bottles
path: '*.bottle.*'
brew-bottle:
runs-on: ubuntu-latest
needs: build-bottles
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
debug: true
- name: Checkout the repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set up git
uses: Homebrew/actions/git-user-config@master
- name: Download bottle artifacts
uses: actions/download-artifact@v3
with:
name: bottles
- name: Merge bottles
run: brew bottle --merge --write --debug ./*.bottle.json
- name: Push commits
run: git push
publish-bottles:
runs-on: ubuntu-latest
needs: brew-bottle
environment: release
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
debug: true
- name: Download bottle artifacts
uses: actions/download-artifact@v3
with:
name: bottles
- name: Upload bottles
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
run: brew pr-upload --debug --upload-only