-
Notifications
You must be signed in to change notification settings - Fork 3
120 lines (106 loc) · 3.17 KB
/
Copy pathrelease.yml
File metadata and controls
120 lines (106 loc) · 3.17 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
name: Release
on:
push:
tags:
- 'v*-go'
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Fetch dependencies
run: |
go get github.com/jackc/pgx/v5@latest
go mod tidy
env:
GOFLAGS: '-mod=mod'
- name: Run tests
run: go test ./internal/...
build:
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# ── Linux ──────────────────────────────────────
- goos: linux
goarch: amd64
artifact: med-exam-linux-amd64
- goos: linux
goarch: arm64
artifact: med-exam-linux-arm64
- goos: linux
goarch: arm
goarm: 7
artifact: med-exam-linux-armv7
- goos: linux
goarch: "386"
artifact: med-exam-linux-386
- goos: linux
goarch: loong64
artifact: med-exam-linux-loong64
# ── macOS ──────────────────────────────────────
- goos: darwin
goarch: amd64
artifact: med-exam-darwin-amd64
- goos: darwin
goarch: arm64
artifact: med-exam-darwin-arm64
# ── Windows ────────────────────────────────────
- goos: windows
goarch: amd64
artifact: med-exam-windows-amd64.exe
- goos: windows
goarch: arm64
artifact: med-exam-windows-arm64.exe
- goos: windows
goarch: "386"
artifact: med-exam-windows-386.exe
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Fetch dependencies (sqlite + pgx)
run: |
go get modernc.org/sqlite@latest
go get github.com/jackc/pgx/v5@latest
go mod tidy
env:
GOFLAGS: '-mod=mod'
- name: Build (with PostgreSQL support)
env:
CGO_ENABLED: '0'
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm || '' }}
run: go build -ldflags="-s -w" -o ${{ matrix.artifact }} .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: false
generate_release_notes: true
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}