Skip to content

Commit d163a4c

Browse files
committed
ci: Add Windows build/release
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
1 parent f280665 commit d163a4c

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ name: Cross-platform Builds
66
on:
77
pull_request:
88
branches: [ "main" ]
9+
push:
10+
branches: [ "**" ]
911

1012
jobs:
1113

@@ -16,10 +18,16 @@ jobs:
1618
include:
1719
- goos: linux
1820
goarch: amd64
21+
artifact_name: bibcheck-linux-amd64
1922
- goos: darwin
2023
goarch: arm64
24+
artifact_name: bibcheck-darwin-arm64
2125
- goos: darwin
2226
goarch: amd64
27+
artifact_name: bibcheck-darwin-amd64
28+
- goos: windows
29+
goarch: amd64
30+
artifact_name: bibcheck-windows-amd64.exe
2331
steps:
2432
- name: Set timezone
2533
run: sudo timedatectl set-timezone "America/Denver"
@@ -36,8 +44,8 @@ jobs:
3644

3745
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3846

39-
- name: Build
47+
- name: Build release binary
4048
env:
4149
GOOS: ${{ matrix.goos }}
4250
GOARCH: ${{ matrix.goarch }}
43-
run: go build -v -ldflags "-X version.gitSha=$GIT_SHA -X version.buildDate=$BUILD_DATE" main.go
51+
run: go build -v -ldflags "-X version.gitSha=$GIT_SHA -X version.buildDate=$BUILD_DATE" -o "${{ matrix.artifact_name }}" main.go

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ jobs:
1717
include:
1818
- goos: linux
1919
goarch: amd64
20+
artifact_name: bibcheck-linux-amd64
2021
- goos: darwin
2122
goarch: arm64
23+
artifact_name: bibcheck-darwin-arm64
2224
- goos: darwin
2325
goarch: amd64
26+
artifact_name: bibcheck-darwin-amd64
27+
- goos: windows
28+
goarch: amd64
29+
artifact_name: bibcheck-windows-amd64.exe
2430
steps:
2531
- name: Set timezone
2632
run: sudo timedatectl set-timezone "America/Denver"
@@ -41,12 +47,12 @@ jobs:
4147
env:
4248
GOOS: ${{ matrix.goos }}
4349
GOARCH: ${{ matrix.goarch }}
44-
run: go build -v -ldflags "-X version.gitSha=$GIT_SHA -X version.buildDate=$BUILD_DATE" -o "bibcheck-${{ matrix.goos }}-${{ matrix.goarch }}" main.go
50+
run: go build -v -ldflags "-X version.gitSha=$GIT_SHA -X version.buildDate=$BUILD_DATE" -o "${{ matrix.artifact_name }}" main.go
4551

4652
- name: Upload Release Asset
4753
uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # v2.11.3
4854
with:
49-
file: bibcheck-${{ matrix.goos }}-${{ matrix.goarch }}
50-
asset_name: bibcheck-${{ matrix.goos }}-${{ matrix.goarch }}
55+
file: ${{ matrix.artifact_name }}
56+
asset_name: ${{ matrix.artifact_name }}
5157
tag: ${{ github.ref }}
52-
overwrite: true
58+
overwrite: true

0 commit comments

Comments
 (0)