Repository navigation
122 lines (95 loc) · 2.96 KB
/
Copy pathci.yml
File metadata and controls
122 lines (95 loc) · 2.96 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: CI
on:
push:
branches: [main]
tags-ignore:
- "v*"
pull_request:
branches: [main]
permissions:
contents: read
env:
GOFLAGS: "-trimpath"
jobs:
lint:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- name: Verify modules
run: go mod verify
- name: Install go-winres
run: go install github.com/tc-hib/go-winres@latest
- name: Generate Windows resources
run: go generate ./...
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: golangci-lint
run: golangci-lint run --timeout=5m ./...
- name: Vet
run: go vet ./...
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
test:
needs: lint
runs-on: windows-latest
strategy:
matrix:
go: ["1.25"]
name: Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- name: Install go-winres
run: go install github.com/tc-hib/go-winres@latest
- name: Generate Windows resources
run: go generate ./...
- name: Test
run: go test ./... -v -count=1 -timeout=5m
- name: Test (race detector)
run: go test -race ./... -count=1 -timeout=10m
build:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- name: Install go-winres
run: go install github.com/tc-hib/go-winres@latest
- name: Generate Windows resources
run: go generate ./...
- name: Read version
id: ver
shell: pwsh
run: |
$v = & ./.github/scripts/read-version.ps1
"version=$v" >> $env:GITHUB_OUTPUT
- name: Build conduit (max optimization)
shell: pwsh
run: go build -trimpath -ldflags="-s -w -H=windowsgui -buildid= -X github.com/foursecondfivefour/conduit/internal/config.Version=${{ steps.ver.outputs.version }}" -tags production -o build/conduit.exe .
- name: Build updater (max optimization)
shell: pwsh
run: go build -trimpath -ldflags="-s -w -H=windowsgui -buildid=" -tags production -o build/conduit-updater.exe ./cmd/conduit-updater
- name: Verify binary
shell: pwsh
run: go version -m build/conduit.exe
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: windows-binaries-${{ steps.ver.outputs.version }}
path: |
build/conduit.exe
build/conduit-updater.exe
retention-days: 7