forked from rrwick/Bandage
-
Notifications
You must be signed in to change notification settings - Fork 11
185 lines (152 loc) · 5.93 KB
/
snapshots.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
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
name: build-snapshots
on:
workflow_dispatch:
push:
tags:
- "v*.*"
branches: [ dev ]
env:
BUILD_TYPE: Release
QT_QPA_PLATFORM: offscreen
XDG_RUNTIME_DIR: '/tmp/runtime-runner'
QT_VERSION: 6.2.*
jobs:
build-linux:
runs-on: ubuntu-20.04
name: '🐧 Ubuntu 20.04'
steps:
- id: commit
uses: pr-mpt/actions-commit-hash@v3
- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: '⚙️ Grab cmake & ninja'
uses: lukka/get-cmake@latest
- name: '⚙️ Install Qt'
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache
version: ${{env.QT_VERSION}}
- name: '⚙️ Install dependencies'
run: sudo apt-get install -y appstream
- name: '⚙️ Configure CMake'
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -G Ninja
- name: '🚧 Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: '⚙️ Make AppDir'
working-directory: ${{github.workspace}}/build
run: DESTDIR=AppDir cmake --install ${{github.workspace}}/build
- name: '⚙️ Install Linuxdeploy'
working-directory: ${{github.workspace}}/build
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
- name: '📦 Make AppImage'
working-directory: ${{github.workspace}}/build
run: |
export EXTRA_PLATFORM_PLUGINS="libqoffscreen.so;libqminimal.so"
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage
mv BandageNG*.AppImage BandageNG-Linux-${{steps.commit.outputs.short}}.AppImage
shell: bash
- name: '📤 Upload artifact: AppImage'
uses: actions/upload-artifact@v4
with:
name: BandageNG-Linux-${{steps.commit.outputs.short}}.AppImage
path: ${{github.workspace}}/build/BandageNG*.AppImage
build-mac:
runs-on: macos-latest
name: '🍎 macOS'
steps:
- id: commit
uses: pr-mpt/actions-commit-hash@v3
- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: '⚙️ Grab cmake & ninja'
uses: lukka/get-cmake@latest
- name: '⚙️ Install Qt'
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache
version: ${{env.QT_VERSION}}
- name: '⚙️ Configure CMake'
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_INSTALL_PREFIX=/usr -G Ninja
- name: '🚧 Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: '📦 Make DMG'
working-directory: ${{github.workspace}}/build
run: |
macdeployqt BandageNG.app -dmg
mv *.dmg BandageNG-macOS-${{steps.commit.outputs.short}}.dmg
- name: '📤 Upload artifact: DMG'
uses: actions/upload-artifact@v4
with:
name: BandageNG-macOS-${{steps.commit.outputs.short}}.dmg
path: ${{github.workspace}}/build/BandageNG*.dmg
build-windows:
runs-on: windows-latest
name: '🧊 Windows'
steps:
- id: commit
uses: pr-mpt/actions-commit-hash@v3
- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: '⚙️ Grab cmake & ninja'
uses: lukka/get-cmake@latest
- name: '⚙️ Configure MSVC'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: '⚙️ Install Qt'
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache
version: ${{env.QT_VERSION}}
- name: '⚙️ Configure CMake'
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -G Ninja
- name: '🚧 Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: '📦 Make package'
working-directory: ${{github.workspace}}/build
run: |
mkdir BandageNG
cp BandageNG.exe BandageNG/
windeployqt BandageNG --release --compiler-runtime
7z a BandageNG-win-${{steps.commit.outputs.short}}.zip BandageNG -r
- name: '📤 Upload artifact: ZIP'
uses: actions/upload-artifact@v4
with:
name: BandageNG-win-${{steps.commit.outputs.short}}.zip
path: ${{github.workspace}}/build/BandageNG*.zip
# Upload continuous build
upload:
name: '🗂 Create release and upload artifacts'
needs:
- build-linux
- build-mac
- build-windows
runs-on: ubuntu-20.04
steps:
- name: '⚙️ Install dependencies'
run: sudo apt-get install -y libfuse2
- name: '📥 Download artifacts'
uses: actions/download-artifact@v4
- name: '🗂 Inspect directory after downloading artifacts'
run: ls -alFR
- name: '🚀 Create release and upload artifacts'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage **/BandageNG-Linux-*.AppImage
./pyuploadtool-x86_64.AppImage **/BandageNG-macOS-*.dmg
./pyuploadtool-x86_64.AppImage **/BandageNG-win-*.zip