-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathgithub-workflow-example.yml
More file actions
46 lines (39 loc) · 1.08 KB
/
github-workflow-example.yml
File metadata and controls
46 lines (39 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
42
43
44
45
46
# This is GitHub actions workflow example.
# Put this into `.github/workflows` directory to use.
name: Go Build for Windows
# Rules to trigger job, customize for your needs.
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
goarch: ['386', 'amd64', 'arm64']
env:
GO_VERSION: '1.22' # Define the Go version here
container:
image: ghcr.io/x1unix/docker-go-mingw/go-mingw:${{ env.GO_VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Build for Windows
run: |
echo "Building for Windows ${{ matrix.goarch }}"
go build -o myapp-${{ matrix.goarch }}.exe .
env:
GOARCH: ${{ matrix.goarch }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: myapp-${{ matrix.goarch }}
path: myapp-${{ matrix.goarch }}.exe