Skip to content

Merge pull request #5 from sora-ryu/docs #19

Merge pull request #5 from sora-ryu/docs

Merge pull request #5 from sora-ryu/docs #19

name: Wails build
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
build: [
{name: ACDC, platform: linux/amd64, os: ubuntu-latest},
{name: ACDC, platform: windows/amd64, os: windows-latest},
{name: ACDC, platform: darwin/universal, os: macos-latest},
]
runs-on: ${{ matrix.build.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# - uses: dAppServer/wails-build-action@v2.2
# with:
# build-name: ${{ matrix.build.name }}
# build-platform: ${{ matrix.build.platform }}
# go-version: 1.21
# package: false
- name: Setup Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version: 1.22
- run: go version
shell: bash
# Setup and configure NodeJS
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
shell: bash
- name: Install Linux Wails deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.0-dev gcc-aarch64-linux-gnu
shell: bash
- name: Install macOS Wails deps
if: runner.os == 'macOS'
run: brew install mitchellh/gon/gon
shell: bash
# Building step
- name: Build MacOS App
if: runner.os == 'macOS'
working-directory: .
run: wails build -platform ${{ matrix.build.platform }} -webview2 download -o ACDC
shell: bash
- name: Build Linux App
if: runner.os == 'Linux'
working-directory: .
run: wails build -debug -platform ${{ matrix.build.platform }} -webview2 download -o ACDC
shell: bash
- name: Build Windows App
if: runner.os == 'Windows'
working-directory: .
run: wails build -debug -platform ${{ matrix.build.platform }} -webview2 download -o ACDC
shell: bash
- name: Build .app zip file
if: runner.os == 'macOS'
working-directory: .
shell: bash
run: |
chmod +x build/bin/*/Contents/MacOS/*
ditto -c -k --sequesterRsrc --keepParent ./build/bin/ACDC.app ./build/bin/ACDC.app.zip
- name: Build linux zip file
if: runner.os == 'Linux'
working-directory: .
shell: bash
run: |
chmod +x build/bin/*
zip -j ./build/bin/${{ matrix.build.name }}.zip ./build/bin/${{ matrix.build.name }}
- name: Build windows zip file
if: runner.os == 'Windows'
working-directory: .
shell: pwsh
run: |
Rename-Item -Path ".\build\bin\${{ matrix.build.name }}" -NewName "${{ matrix.build.name }}.exe"
Compress-Archive -LiteralPath '.\build\bin\${{ matrix.build.name }}.exe' -DestinationPath ".\build\bin\${{ matrix.build.name }}.exe.zip"
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.build.name }}-${{ runner.os }}
path: 'build/bin/*.zip'