1212 runs-on : ubuntu-latest
1313 steps :
1414 - uses : actions/checkout@v4
15-
16- - name : Set up Go
17- uses : actions/setup-go@v5
15+ - uses : ./.github/actions/setup
1816 with :
19- go-version : ' 1.26'
20-
21- - name : Install system dependencies
22- run : |
23- sudo apt-get update
24- sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
17+ gl : ' true'
2518
2619 - name : golangci-lint
2720 uses : golangci/golangci-lint-action@v7
@@ -32,84 +25,96 @@ jobs:
3225 runs-on : ubuntu-latest
3326 steps :
3427 - uses : actions/checkout@v4
35-
36- - name : Set up Go
37- uses : actions/setup-go@v5
28+ - uses : ./.github/actions/setup
3829 with :
39- go-version : ' 1.26'
40-
41- - name : Install system dependencies
42- run : |
43- sudo apt-get update
44- sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
30+ gl : ' true'
4531
4632 - name : Test
4733 run : go test -v -cover ./...
4834
49- # Package platform-native app bundles on each OS runner (CGO requires native C compiler) .
50- package :
35+ # Desktop: GUI bundle + native CLI/server binary, built per OS then uploaded .
36+ desktop :
5137 if : startsWith(github.ref, 'refs/tags/v')
5238 needs : [ lint, test ]
5339 strategy :
5440 fail-fast : false
5541 matrix :
5642 include :
57- - runner : ubuntu-latest
58- os : linux
59- artifact : ethiocal-linux-amd64.tar.xz
60- - runner : macos-latest
61- os : darwin
62- artifact : ethiocal-macos-arm64.app.zip
63- - runner : macos-15-intel
64- os : darwin
65- artifact : ethiocal-macos-amd64.app.zip
66- - runner : windows-latest
67- os : windows
68- artifact : ethiocal-windows-amd64.exe.zip
43+ - { runner: ubuntu-latest, os: linux, artifact: ethiocal-linux-amd64.tar.xz, cli: ethiocal-cli-linux-amd64 }
44+ - { runner: macos-latest, os: darwin, artifact: ethiocal-macos-arm64.app.zip, cli: ethiocal-cli-macos-arm64 }
45+ - { runner: macos-15-intel, os: darwin, artifact: ethiocal-macos-amd64.app.zip, cli: ethiocal-cli-macos-amd64 }
46+ - { runner: windows-latest, os: windows, artifact: ethiocal-windows-amd64.exe.zip, cli: ethiocal-cli-windows-amd64.exe }
6947
7048 runs-on : ${{ matrix.runner }}
7149 steps :
7250 - uses : actions/checkout@v4
73-
74- - name : Set up Go
75- uses : actions/setup-go@v5
51+ - uses : ./.github/actions/setup
7652 with :
77- go-version : ' 1.26'
53+ gl : ' true'
54+ fyne : ' true'
7855
79- - name : Install system dependencies (Linux)
80- if : matrix.os == 'linux'
81- run : |
82- sudo apt-get update
83- sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
84-
85- - name : Install fyne CLI
86- run : go install fyne.io/tools/cmd/fyne@latest
87-
88- - name : Package
56+ # Build both: GUI bundle (CGO) and CLI (pure Go).
57+ - name : Build GUI bundle
8958 run : fyne package -os ${{ matrix.os }} -release
9059
91- - name : Prepare artifact (macOS)
60+ - name : Build CLI
61+ env :
62+ CGO_ENABLED : ' 0'
63+ run : go build -trimpath -ldflags '-s -w' -o ${{ matrix.cli }} ./cmd/ethiocal-cli
64+
65+ # Pack the GUI bundle into one named file (fyne's output differs per OS).
66+ - name : Pack GUI bundle (macOS)
9267 if : matrix.os == 'darwin'
9368 run : zip -r ${{ matrix.artifact }} Ethiocal.app
9469
95- - name : Prepare artifact (Linux)
70+ - name : Pack GUI bundle (Linux)
9671 if : matrix.os == 'linux'
9772 run : mv Ethiocal.tar.xz ${{ matrix.artifact }}
9873
99- - name : Prepare artifact (Windows)
74+ - name : Pack GUI bundle (Windows)
10075 if : matrix.os == 'windows'
10176 shell : pwsh
10277 run : Compress-Archive -Path Ethiocal.exe -DestinationPath ${{ matrix.artifact }}
10378
104- - name : Upload artifact
79+ - name : Upload GUI bundle
10580 uses : actions/upload-artifact@v4
10681 with :
10782 name : ${{ matrix.artifact }}
10883 path : ${{ matrix.artifact }}
10984
85+ - name : Upload CLI
86+ uses : actions/upload-artifact@v4
87+ with :
88+ name : ${{ matrix.cli }}
89+ path : ${{ matrix.cli }}
90+
91+ # Mobile: arm64-v8a APK. Debug-signed for sideloading;
92+ # NDK preinstalled on the runner; metadata from FyneApp.toml.
93+ mobile :
94+ if : startsWith(github.ref, 'refs/tags/v')
95+ needs : [ lint, test ]
96+ runs-on : ubuntu-latest
97+ steps :
98+ - uses : actions/checkout@v4
99+ - uses : ./.github/actions/setup
100+ with :
101+ fyne : ' true'
102+
103+ # Uses the runner's preinstalled NDK via its default ANDROID_NDK_HOME.
104+ - name : Build APK
105+ run : |
106+ fyne package --os android/arm64
107+ mv Ethiocal.apk ethiocal-android.apk
108+
109+ - name : Upload APK
110+ uses : actions/upload-artifact@v4
111+ with :
112+ name : ethiocal-android.apk
113+ path : ethiocal-android.apk
114+
110115 release :
111116 if : startsWith(github.ref, 'refs/tags/v')
112- needs : package
117+ needs : [ desktop, mobile ]
113118 runs-on : ubuntu-latest
114119 permissions :
115120 contents : write
0 commit comments