-
Notifications
You must be signed in to change notification settings - Fork 0
207 lines (184 loc) · 6.77 KB
/
Copy pathrelease.yml
File metadata and controls
207 lines (184 loc) · 6.77 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: Build release
on:
push:
tags:
- "*"
permissions:
contents: write
discussions: write
env:
NODE_OPTIONS: "--max-old-space-size=4096"
BUILD: "true"
WORKING_DIRECTORY: "."
WEBVIEW2: "browser"
jobs:
build:
strategy:
# Failure in one platform build won't impact the others
fail-fast: false
matrix:
build:
- name: "spinup"
platform: "linux/amd64"
os: "ubuntu-22.04"
- name: "spinup"
platform: "darwin/universal"
os: "macos-latest"
# - name: 'Spinup'
# platform: 'windows/amd64'
# os: 'windows-latest'
runs-on: ${{ matrix.build.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
# Setup and configure Go
- name: Setup Go
uses: actions/setup-go@v6
with:
check-latest: true
go-version: "1.24"
- run: go version
shell: bash
# Setup pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10
run_install: false
# Setup and configure NodeJS
- name: Setup NodeJS
uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
cache-dependency-path: "./frontend/pnpm-lock.yaml"
# Get the version from the common/.version file and set it as an environment variable
- name: Set SPINUP_VERSION
id: get_version
run: echo "SPINUP_VERSION=$(cat ./common/.version | sed 's/^v//')" >> $GITHUB_ENV
shell: bash
# install Wails
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
shell: bash
- name: Update Ubuntu package list
if: runner.os == 'Linux'
run: sudo apt-get update
shell: bash
- name: Install Ubuntu Wails deps
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-0 libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev gcc-aarch64-linux-gnu rpm
- name: Install macOS Wails deps
if: runner.os == 'macOS'
run: brew install mitchellh/gon/gon
shell: bash
# Building step
- name: Build Linux App
if: runner.os == 'Linux'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
sed -i.bak "s/{{version}}/${{ env.SPINUP_VERSION }}/g" wails.json && rm wails.json.bak
wails build --platform ${{ matrix.build.platform }} -webview2 ${{ env.WEBVIEW2 }} -o ${{ matrix.build.name }}-${{ env.SPINUP_VERSION }} -tags webkit2_40
wails build --platform ${{ matrix.build.platform }} -webview2 ${{ env.WEBVIEW2 }} -o ${{ matrix.build.name }}-${{ env.SPINUP_VERSION }}-ubuntu24.04 -tags webkit2_41
shell: bash
- name: Build macOs App
if: runner.os == 'macOS'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
sed -i.bak "s/{{version}}/${{ env.SPINUP_VERSION }}/g" wails.json && rm wails.json.bak
wails build --platform ${{ matrix.build.platform }} -webview2 ${{ env.WEBVIEW2 }} -o ${{ matrix.build.name }}
shell: bash
- name: Build Windows App + Installer
if: runner.os == 'Windows'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
sed -i "s/{{version}}/${{ env.SPINUP_VERSION }}/g" wails.json
wails build --platform ${{ matrix.build.platform }} -webview2 ${{ env.WEBVIEW2 }} -nsis -o ${{ matrix.build.name }}-${{ env.SPINUP_VERSION }}
shell: bash
# Add permissions to the binary
- name: Add Linux perms
if: runner.os == 'Linux'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: chmod +x build/bin/*
shell: bash
- name: Add macOS perms
if: runner.os == 'macOS'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: chmod +x build/bin/*/Contents/MacOS/*
shell: bash
# Generate icons for Linux and macOS
- name: Load cached icons
# if: runner.os == 'Linux' || runner.os == 'macOS'
if: runner.os == 'Linux'
id: cache-icons
uses: actions/cache@v4
with:
key: ${{ runner.os }}-icons-${{ hashFiles('images/icon-large.png') }}
path: |
packaging/unix/usr/share/icons
packaging/unix/usr/share/pixmaps
- name: Generate icons
# if: (runner.os == 'Linux' || runner.os == 'macOS') && steps.cache-icons.outputs.cache-hit != 'true'
if: runner.os == 'Linux' && steps.cache-icons.outputs.cache-hit != 'true'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: bash ./scripts/generate-icons.sh
shell: bash
# Package as .deb for Ubuntu
- name: Package as .deb for Ubuntu
if: runner.os == 'Linux'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: bash ./scripts/release/package-deb.sh
# Package as .zip for macOS
- name: Package as .zip for macOS
if: runner.os == 'macOS'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: bash ./scripts/release/package-macos-zip.sh
# Package as .rpm for RPM based distros
- name: Package as .rpm for RPM based distros
if: runner.os == 'Linux'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: bash ./scripts/release/package-rpm.sh
# Check if Ubuntu deb installs correctly
- name: Check if Ubuntu deb installs correctly
if: runner.os == 'Linux'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
sudo apt-get install -y libgtk-3-0 libwebkit2gtk-4.1-dev nginx dnsmasq
sudo dpkg -i ./deb/spinup-${{ env.SPINUP_VERSION }}-ubuntu24.04.deb
spinup --version
shell: bash
# Check if macOS zip installs correctly
- name: Check if macOS zip installs correctly
if: runner.os == 'macOS'
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
brew install nginx dnsmasq
unzip -q -o ./spinup-${{ env.SPINUP_VERSION }}-macos.zip -d /tmp/spinup
cd /tmp/spinup/
sudo bash ./install.sh
spinup --version
shell: bash
# Upload build assets
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build.name }} (${{ runner.os }})
path: |
*/bin/*.exe
*\bin\*.exe
*/spinup-*.deb
spinup-*.rpm
spinup-*.zip
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
files: |
*/bin/*.exe
*/spinup-*.deb
spinup-*.rpm
spinup-*.zip