feat: cross-compile for multiple platforms
All checks were successful
Cross-Compile Binaries / compile-linux (push) Successful in 6m45s
Cross-Compile Binaries / compile-windows (push) Successful in 10m5s

This commit is contained in:
2025-11-27 10:53:27 +01:00
parent d0d2a80a02
commit a06ee7662f
2 changed files with 64 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ on:
- '*'
jobs:
cross-compile:
compile-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -22,8 +22,66 @@ jobs:
with:
go-version: 'stable'
- name: Install the Fyne cross-compile package
run: go install github.com/fyne-io/fyne-cross@latest
- name: Install build dependencies
run: |
apt-get update && apt-get install -y \
build-essential libgl1-mesa-dev libx11-dev libxrandr-dev \
libxi-dev libxcursor-dev libxinerama-dev libglfw3-dev \
libxxf86vm-dev
- name: Cross compile linux
run: /root/go/bin/fyne-cross linux --icon Icon.png
- name: Compile the fyne application for native Linux
run: |
export CGO_ENABLED=1
export CC=gcc
export CXX=g++
export GOOS=linux
export GOARCH=amd64
go build -o ./pkcs-generator .
- name: upload the building actifacts
uses: christopherHX/gitea-upload-artifact@v4
with:
name: packages
path: |
./pkcs-generator
retention-days: 3
overwrite: true
compile-windows:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout and pull the code
uses: actions/checkout@v5
- name: Setup the Go programming language
uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Install build dependencies
run: |
apt-get update && apt-get install -y \
build-essential libgl1-mesa-dev libx11-dev libxrandr-dev \
libxi-dev libxcursor-dev libxinerama-dev libglfw3-dev \
libxxf86vm-dev gcc-mingw-w64 gcc-multilib
- name: Compile the fyne application for Windows
run: |
export CGO_ENABLED=1
export GOOS=windows
export GOARCH=amd64
export CC=x86_64-w64-mingw32-gcc
export CXX=x86_64-w64-mingw32-g++
export CGO_LDFLAGS="-static-libgcc -static-libstdc++"
go build -o ./pkcs-generator.exe -ldflags -H=windowsgui .
- name: upload the building actifacts
uses: christopherHX/gitea-upload-artifact@v4
with:
name: packages
path: |
./pkcs-generator.exe
retention-days: 3
overwrite: true

1
.gitignore vendored
View File

@@ -1,5 +1,4 @@
*
!*.*
!*/
fyne-cross
*.exe