-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (116 loc) · 3.66 KB
/
Copy pathbuild.yml
File metadata and controls
138 lines (116 loc) · 3.66 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Release Desktop App
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
permissions:
contents: write
env:
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
release:
name: Release Desktop App
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set build name with tag
shell: bash
run: |
OS_NAME=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
if [ "$OS_NAME" = "macos" ]; then OS_NAME="darwin"; fi
echo "BUILD_NAME=can-finder-${GITHUB_REF_NAME}.${OS_NAME}-amd64" >> $GITHUB_ENV
version=$(echo ${GITHUB_REF_NAME} | sed -e 's/^v//')
echo "BUILD_VER=$version" >> $GITHUB_ENV
- name: Echo vars
shell: bash
run: |
echo "Build name: ${{ env.BUILD_NAME }}"
echo "Version: ${{ env.BUILD_VER }}"
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.24.0"
- name: Install Wails CLI
shell: bash
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
wails doctor
- name: Install Linux prerequisites
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev jq build-essential pkg-config
- name: Install macOS prerequisites
if: runner.os == 'macOS'
shell: bash
run: |
brew install gtk+3 jq pkg-config
- name: Install Windows prerequisites
if: runner.os == 'Windows'
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install nsis jq
- name: Build App (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
wails build -clean -tags webkit2_41 -o ${{ env.BUILD_NAME }}
- name: Build App (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
wails build -clean -platform darwin/universal
- name: Build NSIS Installer (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
wails build -clean -nsis -webview2 embed
- name: Show build files (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
Get-ChildItem ./build/bin -Recurse -Force
- name: Rename Windows Installer
if: runner.os == 'Windows'
working-directory: ./build/bin
shell: powershell
run: |
$installer = Get-ChildItem "*-installer.exe" | Select-Object -First 1
if ($null -eq $installer) {
Write-Error "Installer not found!"
exit 1
}
Rename-Item -Path $installer.FullName -NewName "${{ env.BUILD_NAME }}.exe"
- name: Show build artifacts
shell: bash
run: |
ls -alh ./build/bin || true
ls -alh build/*.app || true
- name: Archive macOS App
if: runner.os == 'macOS'
shell: bash
run: |
cd build/bin
zip -r ../../${{ env.BUILD_NAME }}.zip *.app
- name: Upload Release Assets (macOS)
if: runner.os == 'macOS'
uses: softprops/action-gh-release@v2
with:
files: |
*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Assets (Windows)
if: runner.os == 'Windows'
uses: softprops/action-gh-release@v2
with:
files: |
build/bin/${{ env.BUILD_NAME }}.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}