This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (87 loc) · 3.12 KB
/
build-packages.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
83
84
85
86
87
88
89
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/[email protected]
# 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'