-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (66 loc) · 1.69 KB
/
go.yaml
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
58
59
60
61
62
63
64
65
66
67
68
name: Go
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
jobs:
build-windows:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: "true"
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Check for Go Generate diff
run: |
go generate ./...
if [ $(git status --porcelain | wc -l) -eq "0" ]; then
echo "🟢 All files up-to-date."
else
echo "🔴 'go generate' produced a diff."
exit 1
fi
- name: Setup build environment
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends --no-install-suggests libgl1-mesa-dev xorg-dev gcc-mingw-w64-x86-64
- name: Build
run: GOOS=windows CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc-win32 go build -o ./build/lanty.exe -v -ldflags -H=windowsgui ./cmd
- name: Package
run: cp ./settings.yaml ./build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: lanty
path: ./build
if-no-files-found: error
retention-days: 1
overwrite: "true"
release:
if: github.ref_type == 'tag'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
- name: Zip artifact
uses: vimtor/[email protected]
with:
files: ./lanty
dest: lanty.zip
- name: Create Release
if:
uses: softprops/action-gh-release@v1
with:
files: |
lanty.zip
generate_release_notes: true
needs: build-windows