Skip to content

Commit aeeb003

Browse files
committed
add stage to build homebrew tap
1 parent 8fbad40 commit aeeb003

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

.github/workflows/main.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
4444
# Build for Ubuntu Linux
4545
build-linux:
46+
name: Build gitconvex for linux
4647
needs: gitconvex-test
4748
runs-on: ubuntu-latest
4849
steps:
@@ -98,13 +99,10 @@ jobs:
9899
99100
# Build for MacOS
100101
build-macos:
102+
name: Build gitconvex for MacOS
101103
needs: gitconvex-test
102104
runs-on: macos-latest
103105
steps:
104-
- name: Install brew
105-
run: |
106-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
107-
108106
- name: Set up Go 1.x
109107
uses: actions/setup-go@v2
110108
with:
@@ -134,6 +132,7 @@ jobs:
134132
135133
# Test Build for Windows
136134
build-windows:
135+
name: Build gitconvex for Windows
137136
needs: gitconvex-test
138137
runs-on: windows-latest
139138
defaults:
@@ -190,3 +189,42 @@ jobs:
190189
echo ${{ secrets.CLI_AUTH_KEY }} > auth.txt
191190
gh auth login --with-token < auth.txt
192191
gh release upload ${{ secrets.TARGET_RELEASE_CHANNEL }} ./dist/gitconvex-windows-v${{ secrets.TARGET_RELEASE_CHANNEL }}.zip --clobber
192+
193+
# Build for Homebrew
194+
build-for-homebrew:
195+
name: Build gitconvex Homebrew Tap bundle
196+
needs: gitconvex-test
197+
runs-on: macos-latest
198+
steps:
199+
- name: Set up Go 1.x
200+
uses: actions/setup-go@v2
201+
with:
202+
go-version: ^1.16
203+
id: go
204+
205+
- name: Check out code into the Go module directory
206+
uses: actions/checkout@v2
207+
208+
- name: Get dependencies
209+
run: |
210+
brew install libssh2
211+
brew install libgit2
212+
go get -v ./...
213+
214+
- name: Package gitconvex bundle
215+
run: |
216+
make build
217+
rm ./dist/gitconvex
218+
219+
- name: Pick only required content for the Homebrew Tap
220+
run: |
221+
mkdir brew
222+
cp -rp api/ git/ global/ graph/ tests/ utils/ go.mod go.sum gqlgen.yml LICENSE server.go dist/ ./brew/
223+
cd brew
224+
tar -czf gitconvex-v${{ secrets.TARGET_RELEASE_CHANNEL }}-brew.tar.gz *
225+
226+
- name: Github CLI Release for MacOS
227+
run: |
228+
echo ${{ secrets.CLI_AUTH_KEY }} > auth.txt
229+
gh auth login --with-token < auth.txt
230+
gh release upload ${{ secrets.TARGET_RELEASE_CHANNEL }} ./brew/gitconvex-v${{ secrets.TARGET_RELEASE_CHANNEL }}-brew.tar.gz --clobber

0 commit comments

Comments
 (0)