Skip to content

Commit 07fb01d

Browse files
Merge pull request #2 from KnackTech/chore/build-csvdiff-binary-gh-actions
Add build workflow for Linux and macOS builds
2 parents d156109 + 173e262 commit 07fb01d

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and upload artifacts (linux/amd64 and darwin/arm64)
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- goos: linux
16+
goarch: amd64
17+
- goos: darwin
18+
goarch: arm64
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version-file: go.mod
28+
cache: true
29+
30+
- name: Download dependencies
31+
run: go get ./...
32+
33+
- name: Build (${{ matrix.goos }}-${{ matrix.goarch }})
34+
env:
35+
GOOS: ${{ matrix.goos }}
36+
GOARCH: ${{ matrix.goarch }}
37+
CGO_ENABLED: "0"
38+
run: |
39+
mkdir -p dist
40+
echo "Building for $GOOS/$GOARCH"
41+
out="dist/csvdiff-${GOOS}-${GOARCH}"
42+
go build -o "$out"
43+
44+
- name: Upload artifact (${{ matrix.goos }}-${{ matrix.goarch }})
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: csvdiff-${{ matrix.goos }}-${{ matrix.goarch }}
48+
path: dist/csvdiff-${{ matrix.goos }}-${{ matrix.goarch }}
49+
if-no-files-found: error
50+
retention-days: 14

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ require (
1111
github.com/stretchr/testify v1.8.4
1212
)
1313

14-
go 1.13
14+
go 1.25.4

0 commit comments

Comments
 (0)