-
Notifications
You must be signed in to change notification settings - Fork 19
232 lines (201 loc) · 7.12 KB
/
linux.yml
File metadata and controls
232 lines (201 loc) · 7.12 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
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
name: Linux builds
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types:
- published
- prereleased
jobs:
build-amd64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install dependencies
run: |
sudo apt update -qq
sudo apt install lftp qtbase5-dev qt5-default qttools5-dev-tools
- name: Initialize project
run: qmake DDCToolbox.pro "CONFIG += CI" "CONFIG += no_tests"
- name: Build
run: |
make
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: DDCToolbox_Portable_linux64
path: src/DDCToolbox
build-deb-amd64:
runs-on: ubuntu-20.04
needs: [build-amd64]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Prepare version information (1/3)
uses: oprypin/find-latest-tag@v1
with:
repository: ThePBone/DDCToolbox
releases-only: true
id: last_release
- name: Prepare version information (2/3)
uses: benjlevesque/short-sha@v1.2
id: short-sha
with:
length: 6
- name: Prepare version information (3/3)
run: echo '::set-output name=version::${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}'
id: version
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
name: DDCToolbox_Portable_linux64
- name: Build DEB package
run: |
chmod +x ./deployment/build_deb_package.sh
./deployment/build_deb_package.sh ${{steps.version.outputs.version}}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ddctoolbox_${{steps.version.outputs.version}}_linux64.deb
path: ddctoolbox_${{steps.version.outputs.version}}_linux64.deb
publish-nightly:
runs-on: ubuntu-latest
needs: [build-amd64, build-deb-amd64]
steps:
- name: Prepare version information (1/3)
uses: oprypin/find-latest-tag@v1
with:
repository: ThePBone/DDCToolbox
releases-only: true
id: last_release
- name: Prepare version information (2/3)
uses: benjlevesque/short-sha@v1.2
id: short-sha
with:
length: 6
- name: Prepare version information (3/3)
run: echo '::set-output name=version::${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}'
id: version
- name: Download portable artifact
uses: actions/download-artifact@v4.1.7
with:
name: DDCToolbox_Portable_linux64
- name: Download package artifact
uses: actions/download-artifact@v4.1.7
with:
name: ddctoolbox_${{steps.version.outputs.version}}_linux64.deb
- name: Rename portable artifact
run: mv DDCToolbox ddctoolbox_${{steps.version.outputs.version}}_linux64.bin
- name: Upload binary to nightly server
uses: wlixcc/SFTP-Deploy-Action@v1.0
with:
username: 'tim'
server: 'local.timschneeberger.me'
port: 22
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_path: './ddctoolbox_${{steps.version.outputs.version}}_linux64.bin'
remote_path: '/srv/http/nightly.timschneeberger.me/ddctoolbox-linux/'
args: '-o ConnectTimeout=5'
- name: Upload deb package to nightly server
uses: wlixcc/SFTP-Deploy-Action@v1.0
with:
username: 'tim'
server: 'local.timschneeberger.me'
port: 22
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_path: './ddctoolbox_${{steps.version.outputs.version}}_linux64.deb'
remote_path: '/srv/http/nightly.timschneeberger.me/ddctoolbox-linux/'
args: '-o ConnectTimeout=5'
attach-to-release:
runs-on: ubuntu-latest
needs: [build-deb-amd64]
if: github.event_name == 'release'
steps:
- name: Prepare version information (1/3)
uses: oprypin/find-latest-tag@v1
with:
repository: ThePBone/DDCToolbox
releases-only: true
id: last_release
- name: Prepare version information (2/3)
uses: benjlevesque/short-sha@v1.2
id: short-sha
with:
length: 6
- name: Prepare version information (3/3)
run: echo '::set-output name=version::${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}'
id: version
- name: Download package artifact
uses: actions/download-artifact@v4.1.7
with:
name: ddctoolbox_${{steps.version.outputs.version}}_linux64.deb
- uses: AButler/upload-release-assets@v2.0
with:
files: '*.deb'
repo-token: ${{ secrets.GITHUB_TOKEN }}
update-ppa:
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [build-deb-amd64]
steps:
- uses: actions/checkout@v2
with:
repository: 'ThePBone/PPA-Repository'
token: ${{ secrets.REPO_AUTH_TOKEN }}
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0
- name: Prepare version information (1/3)
uses: oprypin/find-latest-tag@v1
with:
repository: ThePBone/DDCToolbox
releases-only: false
id: last_release
- name: Prepare version information (2/3)
uses: benjlevesque/short-sha@v1.2
id: short-sha
with:
length: 6
- name: Prepare version information (3/3)
run: echo '::set-output name=version::${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}'
id: version
- name: Download package artifact
uses: actions/download-artifact@v4.1.7
with:
name: ddctoolbox_${{steps.version.outputs.version}}_linux64.deb
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: GPG user IDs
run: |
echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}"
echo "keyid: ${{ steps.import_gpg.outputs.keyid }}"
echo "name: ${{ steps.import_gpg.outputs.name }}"
echo "email: ${{ steps.import_gpg.outputs.email }}"
- name: Update packages
run: |
sudo apt install dpkg-dev apt-utils
export EMAIL="tim.schneeberger@outlook.de"
dpkg-scanpackages --multiversion . > Packages
gzip -k -f Packages
apt-ftparchive release . > Release
gpg --default-key "${EMAIL}" -abs -o - Release > Release.gpg
gpg --default-key "${EMAIL}" --clearsign -o - Release > InRelease
- name: Commit
run: |
git config --local user.email "tim.schneeberger@outlook.de"
git config --local user.name "Tim Schneeberger"
git add .
git commit -m "Update DDCToolbox packages"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.REPO_AUTH_TOKEN }}
repository: ThePBone/PPA-Repository
force: true