-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (122 loc) · 4.38 KB
/
build.yml
File metadata and controls
145 lines (122 loc) · 4.38 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
139
140
141
142
143
144
145
name: Build
on:
push:
branches: [master, main]
tags: ["v*"]
pull_request:
branches: [master, main]
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
platform: windows
artifact: MarkViewPro.exe
- os: macos-latest
platform: darwin
artifact: MarkViewPro.app
- os: ubuntu-latest
platform: linux
artifact: MarkViewPro
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install NSIS (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install nsis -y
$env:PATH = "C:\Program Files (x86)\NSIS;$env:PATH"
echo "C:\Program Files (x86)\NSIS" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
makensis /VERSION
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Setup webkit2gtk-4.0 compatibility
if: matrix.os == 'ubuntu-latest'
run: |
sudo ln -sf /usr/lib/x86_64-linux-gnu/pkgconfig/webkit2gtk-4.1.pc /usr/lib/x86_64-linux-gnu/pkgconfig/webkit2gtk-4.0.pc
- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build (Windows with NSIS)
if: matrix.os == 'windows-latest'
run: |
wails build -platform ${{ matrix.platform }}/amd64 -nsis
dir build\bin
- name: Build (macOS/Linux)
if: matrix.os != 'windows-latest'
run: wails build -platform ${{ matrix.platform }}/amd64
- name: Upload artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: MarkViewPro-windows
path: |
build/bin/MarkViewPro.exe
build/bin/MarkViewPro-amd64-installer.exe
- name: Upload artifact (macOS)
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: MarkViewPro-macos
path: build/bin/MarkViewPro.app
- name: Upload artifact (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: MarkViewPro-linux
path: build/bin/MarkViewPro
release:
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release files
run: |
mkdir -p release
ls -la artifacts/
ls -la artifacts/MarkViewPro-windows/ || true
ls -la artifacts/MarkViewPro-macos/ || true
ls -la artifacts/MarkViewPro-linux/ || true
# Copy Windows executable
cp artifacts/MarkViewPro-windows/MarkViewPro.exe release/MarkViewPro-windows-amd64.exe
# Copy Windows installer if it exists
if [ -f artifacts/MarkViewPro-windows/MarkViewPro-amd64-installer.exe ]; then
cp artifacts/MarkViewPro-windows/MarkViewPro-amd64-installer.exe release/MarkViewPro-windows-amd64-installer.exe
else
echo "Warning: NSIS installer not found"
fi
# Zip macOS app bundle
cd artifacts/MarkViewPro-macos
zip -r ../../release/MarkViewPro-macos-amd64.zip .
cd ../..
# Copy Linux executable
cp artifacts/MarkViewPro-linux/MarkViewPro release/MarkViewPro-linux-amd64
chmod +x release/MarkViewPro-linux-amd64
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
release/MarkViewPro-windows-amd64.exe
release/MarkViewPro-windows-amd64-installer.exe
release/MarkViewPro-macos-amd64.zip
release/MarkViewPro-linux-amd64
fail_on_unmatched_files: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}