Skip to content

Build electron assets #16

Build electron assets

Build electron assets #16

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')) }}/