-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.53 KB
/
go.yml
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
47
48
49
50
51
52
53
54
55
56
57
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go build
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
- name: Xvfb
if: runner.os == 'Linux'
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- name: Build (Linux, Windows)
if: runner.os == 'Linux'
run: |
go build -v -o build/tower-defense-lin
- name: Build (Linux, Windows)
if: runner.os == 'Windows'
run: |
env GOOS=windows GOARCH=amd64 go build -v -o build/tower-defense.exe
- name: go build (macOS)
if: runner.os == 'macOS'
run: |
env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -v -o build/tower-defense-mac-arm
env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o build/tower-defense-mac-int
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}
path: build/*