-
Notifications
You must be signed in to change notification settings - Fork 18
82 lines (71 loc) · 2.67 KB
/
auto-build-electron.yml
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
name: Build electron assets
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: amd64
build: buildLinux
- os: ubuntu-latest
arch: arm64
build: buildLinux
- os: macos-latest
arch: amd64
build: buildIOS
- os: macos-latest
arch: arm64
build: buildIOS
- os: windows-latest
arch: amd64
build: buildWindows
- os: windows-latest
arch: 386
build: buildWindows
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Check Go version
run: go version
- name: Install ARM64 cross-compilation toolchain
if: matrix.arch == 'arm64' && matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV
- name: Install MinGW-w64 using Chocolatey
if: runner.os == 'Windows' && matrix.arch == '386'
run: |
curl -L -o mingw32.7z https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z/download
7z x mingw32.7z -oC:/mingw32
- name: Setup and build on Windows ${{ matrix.arch }}
if: runner.os == 'Windows'
run: |
./bootstrap_install_mage.bat
$env:GOARCH="${{ matrix.arch }}"
if ($env:GOARCH -eq "386") {
$env:PATH = "C:/mingw32/bin;$env:PATH"
gcc --version
$env:CC="gcc -m32"
$env:CXX="g++ -m32"
}
mage ${{ matrix.build }}
- name: Setup and build on ${{ matrix.os }} ${{ matrix.arch }}
if: runner.os != 'Windows'
run: |
sudo bash ./bootstrap_install_mage.sh
export GOARCH=${{ matrix.arch }}
sudo -E mage ${{ matrix.build }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-assets
path: shared/${{ (matrix.os == 'macos-latest' && 'ios' || (matrix.os == 'windows-latest' && 'windows' || 'linux')) }}/