Skip to content

Commit db521e4

Browse files
committed
2 parents 8a60d92 + ea307ba commit db521e4

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

.github/workflows/go.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# This workflow will build a golang project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3-
1+
# .github/workflows/go.yml
42
name: Go
53

64
on:
@@ -10,19 +8,26 @@ on:
108
branches: [ "main" ]
119

1210
jobs:
13-
1411
build:
1512
runs-on: ubuntu-latest
1613
steps:
17-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.20'
1820

19-
- name: Set up Go
20-
uses: actions/setup-go@v4
21-
with:
22-
go-version: '1.20'
21+
- name: Test (Linux host)
22+
run: go test -v ./...
2323

24-
- name: Build
25-
run: go build -v ./...
24+
- name: Build Windows .exe (cross-compile)
25+
run: |
26+
mkdir -p dist
27+
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -v -o dist/app.exe ./app
2628
27-
- name: Test
28-
run: go test -v ./...
29+
- name: Upload Windows artifact
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: app-windows-amd64.exe
33+
path: dist/app.exe

0 commit comments

Comments
 (0)