-
Notifications
You must be signed in to change notification settings - Fork 6
283 lines (235 loc) · 10.9 KB
/
deploy.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
name: Deploy
on:
push:
branches:
- master
jobs:
Check:
runs-on: ubuntu-18.04
outputs:
deploy: ${{ steps.check.outputs.check }}
release_tag: ${{ steps.check.outputs.short_check }}
steps:
- uses: actions/checkout@v2
- name: Install Python3
run: |
sudo apt install -y python3
- id: check
name: Check Commit Message
run: |
git clone https://github.com/antony-jr/insight
cd insight
git tag > /tmp/tags.txt
cd ..
rm -rf insight
cat /tmp/tags.txt
result=$(python3 scripts/check.py "$(git log -1 --pretty=%B)" "/tmp/tags.txt")
echo "::set-output name=check::$result"
short_result=$(echo $result | head -c 7)
echo "::set-output name=short_check::$short_result"
BuildAndDeploy:
name: "Build And Deploy"
runs-on: ubuntu-18.04
needs: Check
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo apt-get update -qq
sudo bash scripts/install_deps.sh
# sudo bash scripts/update_gcc.sh
- name: Build Insight (Target x86_64)
id: appimage_build_target_x86_64
run: |
cp -r AppDir AppDirBackup
git clone git://sourceware.org/git/insight.git
cd insight
deploy=${{ needs.Check.outputs.deploy }}
if [ "$deploy" = "false" ]
then
export tag="development"
git checkout master
else
export tag="latest"
git checkout $deploy
fi
export VERSION=x86_64-pc-linux-gnu-$(git rev-parse --short HEAD)
git submodule init
git submodule update # Download all required submodules.
cd ..
bash scripts/build_and_bundle.sh
# Build AppImages
wget -q https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage AppDir/Insight.desktop -bundle-non-qt-libs
bash scripts/copy_libs.sh
bash scripts/apply_patches.sh
bash scripts/purge_unwanted.sh
# Don't know why I did this in the past but "If it runs then why change?" xD :D
wget -q -O AppDir/AppRun https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64
chmod +x AppDir/AppRun
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage -u "gh-releases-zsync|antony-jr|insight|$tag|Insight-x86_64-pc-linux-gnu-*-x86_64.AppImage.zsync" AppDir
wget -q "https://github.com/antony-jr/MakeAppImageTorrent/releases/download/Mk-2/MakeAppImageTorrent-609383f-x86_64.AppImage"
chmod +x MakeAppImageTorrent-609383f-x86_64.AppImage
./MakeAppImageTorrent-609383f-x86_64.AppImage Insight-$VERSION-x86_64.AppImage
echo ::set-output name=appimagefile::Insight-$VERSION-x86_64.AppImage
echo ::set-output name=zsyncfile::Insight-$VERSION-x86_64.AppImage.zsync
echo ::set-output name=torrentfile::Insight-$VERSION-x86_64.AppImage.torrent
# Remove development appimages.
rm -rf MakeAppImageTorrent*
rm -rf appimagetool*
rm -rf linuxdeployqt*
# Cleanup AppDir
rm -rf AppDir
mv AppDirBackup AppDir
rm -rf insight
# Check if all files needed are generated.
file Insight-$VERSION-x86_64.AppImage
file Insight-$VERSION-x86_64.AppImage.zsync
file Insight-$VERSION-x86_64.AppImage.torrent
- name: Build Insight (Target ARM)
id: appimage_build_target_arm
run: |
cp -r AppDir AppDirBackup
git clone git://sourceware.org/git/insight.git
cd insight
deploy=${{ needs.Check.outputs.deploy }}
if [ "$deploy" = "false" ]
then
git checkout master
export tag="development"
else
git checkout $deploy
export tag="latest"
fi
export VERSION=arm-linux-gnueabi-$(git rev-parse --short HEAD)
git submodule init
git submodule update # Download all required submodules.
cd ..
bash scripts/build_and_bundle_target_arm.sh
# Build AppImages
wget -q https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage AppDir/Insight.desktop -bundle-non-qt-libs
bash scripts/apply_patches_target_arm.sh
bash scripts/copy_libs.sh
bash scripts/apply_patches.sh
bash scripts/purge_unwanted.sh
# Don't know why I did this in the past but "If it runs then why change?" xD :D
wget -q -O AppDir/AppRun https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64
chmod +x AppDir/AppRun
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage -u "gh-releases-zsync|antony-jr|insight|$tag|Insight-arm-linux-gnueabi-*-x86_64.AppImage.zsync" AppDir
wget -q "https://github.com/antony-jr/MakeAppImageTorrent/releases/download/Mk-2/MakeAppImageTorrent-609383f-x86_64.AppImage"
chmod +x MakeAppImageTorrent-609383f-x86_64.AppImage
./MakeAppImageTorrent-609383f-x86_64.AppImage Insight-$VERSION-x86_64.AppImage
echo ::set-output name=appimagefile::Insight-$VERSION-x86_64.AppImage
echo ::set-output name=zsyncfile::Insight-$VERSION-x86_64.AppImage.zsync
echo ::set-output name=torrentfile::Insight-$VERSION-x86_64.AppImage.torrent
# Remove development appimages.
rm -rf MakeAppImageTorrent*
rm -rf appimagetool*
rm -rf linuxdeployqt*
# Cleanup AppDir
rm -rf AppDir
mv AppDirBackup AppDir
rm -rf insight
# Check if all files needed are generated.
file Insight-$VERSION-x86_64.AppImage
file Insight-$VERSION-x86_64.AppImage.zsync
file Insight-$VERSION-x86_64.AppImage.torrent
- name: Delete Old Development Builds
if: needs.Check.outputs.deploy == 'false'
uses: dev-drprasad/[email protected]
with:
keep_latest: 0
delete_tag_pattern: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Development Build
if: needs.Check.outputs.deploy == 'false'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Insight-*-x86_64.AppImage*
tag: development
overwrite: true
file_glob: true
prerelease: true
release_name: "Insight Development Builds"
body: "Test Builds for experimentation, should be usable though."
- name: Create Release
if: needs.Check.outputs.deploy != 'false'
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.Check.outputs.release_tag }}
release_name: Release ${{ needs.Check.outputs.release_tag }}
body_path: ./release_notes/${{ needs.Check.outputs.deploy }}.md
draft: false
prerelease: false
- name: Upload AppImage Release Asset (Target x86_64)
if: needs.Check.outputs.deploy != 'false'
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{steps.appimage_build_target_x86_64.outputs.appimagefile}}
asset_name: ${{steps.appimage_build_target_x86_64.outputs.appimagefile}}
asset_content_type: application/octet-stream
- name: Upload AppImage Zsync File Release Asset (Target x86_64)
if: needs.Check.outputs.deploy != 'false'
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{steps.appimage_build_target_x86_64.outputs.zsyncfile}}
asset_name: ${{steps.appimage_build_target_x86_64.outputs.zsyncfile}}
asset_content_type: application/octet-stream
- name: Upload AppImage Torrent File Release Asset (Target x86_64)
if: needs.Check.outputs.deploy != 'false'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{steps.appimage_build_target_x86_64.outputs.torrentfile}}
asset_name: ${{steps.appimage_build_target_x86_64.outputs.torrentfile}}
asset_content_type: application/octet-stream
- name: Upload AppImage Release Asset (Target ARM)
if: needs.Check.outputs.deploy != 'false'
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{steps.appimage_build_target_arm.outputs.appimagefile}}
asset_name: ${{steps.appimage_build_target_arm.outputs.appimagefile}}
asset_content_type: application/octet-stream
- name: Upload AppImage Zsync File Release Asset (Target ARM)
if: needs.Check.outputs.deploy != 'false'
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{steps.appimage_build_target_arm.outputs.zsyncfile}}
asset_name: ${{steps.appimage_build_target_arm.outputs.zsyncfile}}
asset_content_type: application/octet-stream
- name: Upload AppImage Torrent File Release Asset (Target ARM)
if: needs.Check.outputs.deploy != 'false'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{steps.appimage_build_target_arm.outputs.torrentfile}}
asset_name: ${{steps.appimage_build_target_arm.outputs.torrentfile}}
asset_content_type: application/octet-stream