-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (138 loc) · 3.9 KB
/
Copy pathci.yml
File metadata and controls
157 lines (138 loc) · 3.9 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: CI
on:
push:
branches: [ next ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install UI dependencies
working-directory: web
run: npm install
- name: Build UI assets
working-directory: web
run: npm run build
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.25.3'
- name: Run tests
run: go test ./...
cross-build:
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
include:
- goos: linux
goarch: amd64
suffix: linux-amd64
- goos: linux
goarch: arm64
suffix: linux-arm64
- goos: windows
goarch: amd64
suffix: windows-amd64.exe
- goos: darwin
goarch: amd64
suffix: darwin-amd64
- goos: darwin
goarch: arm64
suffix: darwin-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install UI dependencies
working-directory: web
run: npm install
- name: Build UI assets
working-directory: web
run: npm run build
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.25.3'
- name: Cross-compile (CLI only)
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
mkdir -p dist
go build -o dist/opentrans-${{ matrix.suffix }} .
gui-build:
runs-on: ${{ matrix.os }}
needs: test
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
suffix: linux-amd64-gui
install: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev pkg-config
# webview pkg-config still looks for webkit2gtk-4.0; provide a compat symlink
sudo ln -sf /usr/lib/x86_64-linux-gnu/pkgconfig/webkit2gtk-4.1.pc /usr/lib/x86_64-linux-gnu/pkgconfig/webkit2gtk-4.0.pc
- os: windows-latest
goos: windows
goarch: amd64
suffix: windows-amd64-gui.exe
install: |
choco install -y webview2-runtime
- os: macos-latest
goos: darwin
goarch: arm64
suffix: darwin-arm64-gui
install: ""
- os: macos-15-intel
goos: darwin
goarch: amd64
suffix: darwin-amd64-gui
install: ""
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install UI dependencies
working-directory: web
run: npm install
- name: Build UI assets
working-directory: web
run: npm run build
- name: Install GUI dependencies
if: matrix.install != ''
run: ${{ matrix.install }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.25.3'
- name: Build GUI binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 1
run: |
mkdir -p dist
go build -tags gui -o dist/opentrans-${{ matrix.suffix }} .