-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.08 KB
/
Copy pathbuild-cli.yml
File metadata and controls
41 lines (36 loc) · 1.08 KB
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
# GitHub Actions workflow to build Go CLI for Windows and Linux
name: Build Go CLI
on:
push:
paths:
- 'cli/**'
- '.github/workflows/build-cli.yml'
pull_request:
paths:
- 'cli/**'
- '.github/workflows/build-cli.yml'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [windows, linux, darwin]
goarch: [amd64, arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26'
- name: Build CLI (${{ matrix.goos }})
run: |
EXT=""
if [ "${{ matrix.goos }}" = "windows" ]; then EXT=".exe"; fi
cd cli
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v -o build/gitconduit-${{ matrix.goos }}-${{ matrix.goarch }}${EXT}
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: gitconduit-${{ matrix.goos }}-${{ matrix.goarch }}
path: cli/build/gitconduit-${{ matrix.goos }}-${{ matrix.goarch }}*