6
6
- ' docs/**'
7
7
branches :
8
8
- master
9
+ tags :
10
+ - ' [45].[0-9]+.[0-9]+*'
9
11
pull_request :
10
12
paths-ignore :
11
13
- ' docs/**'
44
46
working-directory : ${{ github.workspace }}/obs-studio
45
47
run : |
46
48
git fetch --prune --unshallow
47
- echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
48
49
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
49
50
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
50
51
- name : ' Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
58
59
working-directory : ${{ github.workspace }}/obs-websocket
59
60
run : |
60
61
git fetch --prune --unshallow
61
- echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
62
62
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
63
63
echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
64
+ if [ "${{ env.GIT_TAG }}" ] ; then \
65
+ VERSION="${{ env.GIT_TAG }}" ; \
66
+ else \
67
+ VERSION="${{ env.GIT_HASH }}-git" ; \
68
+ fi
69
+ echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
64
70
- name : ' Restore Cached Qt'
65
71
id : qtcache
66
72
uses : actions/cache@v2
@@ -156,7 +162,11 @@ jobs:
156
162
- name : ' Set PR Artifact Filename'
157
163
shell : bash
158
164
run : |
159
- FILENAME="obs-websocket-${{ env.GIT_HASH }}-Windows"
165
+ if [ "${{ env.GIT_TAG }}" ] ; then \
166
+ FILENAME="obs-websocket-${{ env.GIT_TAG }}-Windows" ; \
167
+ else \
168
+ FILENAME="obs-websocket-${{ env.GIT_HASH }}-git-Windows" ; \
169
+ fi
160
170
echo "WIN_FILENAME=$FILENAME" >> $GITHUB_ENV
161
171
- name : ' Package obs-websocket'
162
172
working-directory : ${{ github.workspace }}/obs-websocket
@@ -175,7 +185,7 @@ jobs:
175
185
if : success()
176
186
uses : actions/upload-artifact@v2-preview
177
187
with :
178
- name : ' ${{ env.GIT_HASH }}-Windows-Installer'
188
+ name : ' obs-websocket- ${{ env.PACKAGE_VERSION }}-Windows-Installer'
179
189
path : ${{ github.workspace }}/obs-websocket/package/*.exe
180
190
ubuntu64 :
181
191
name : " Linux/Ubuntu 64-bit"
@@ -198,7 +208,6 @@ jobs:
198
208
working-directory : ${{ github.workspace }}/obs-studio
199
209
run : |
200
210
git fetch --prune --unshallow
201
- echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
202
211
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
203
212
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
204
213
- name : ' Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
@@ -211,9 +220,14 @@ jobs:
211
220
working-directory : ${{ github.workspace }}/obs-websocket
212
221
run : |
213
222
git fetch --prune --unshallow
214
- echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
215
223
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
216
224
echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
225
+ if [ "${{ env.GIT_TAG }}" ] ; then \
226
+ VERSION="${{ env.GIT_TAG }}" ; \
227
+ else \
228
+ VERSION="${{ env.GIT_HASH }}-git" ; \
229
+ fi
230
+ echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
217
231
- name : ' Install prerequisites (Apt)'
218
232
shell : bash
219
233
run : |
@@ -294,7 +308,11 @@ jobs:
294
308
run : |
295
309
mkdir ./build
296
310
cd ./build
297
- cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=TRUE ..
311
+ if [ "${{ env.GIT_TAG }}" ] ; then \
312
+ cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=TRUE -DCMAKE_BUILD_TYPE=Release .. ; \
313
+ else \
314
+ cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=TRUE .. ; \
315
+ fi
298
316
- name : ' Build obs-websocket'
299
317
working-directory : ${{ github.workspace }}/obs-websocket
300
318
shell : bash
@@ -305,26 +323,30 @@ jobs:
305
323
- name : ' Set PR Artifact Filename'
306
324
shell : bash
307
325
run : |
308
- FILENAME="obs-websocket-1-${{ env.GIT_HASH }}-1_amd64.deb"
326
+ if [ "${{ env.GIT_TAG }}" ] ; then \
327
+ FILENAME="obs-websocket-${{ env.GIT_TAG }}-Ubuntu64.deb" ; \
328
+ else \
329
+ FILENAME="obs-websocket-${{ env.GIT_HASH }}-git-Ubuntu64.deb" ; \
330
+ fi
309
331
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
310
332
- name : ' Package ${{ env.FILENAME }}'
311
333
if : success()
312
334
working-directory : ${{ github.workspace }}/obs-websocket
313
335
shell : bash
314
336
run : |
315
- VERSION="1-${{ env.GIT_HASH }}-git"
316
337
cd ./build
317
338
sudo checkinstall -y --type=debian --fstrans=no -nodoc \
318
- --backup=no --deldoc=yes --install=no --pkgname=obs-websocket --pkgversion=$VERSION \
339
+ --backup=no --deldoc=yes --install=no --pkgname=obs-websocket --pkgversion=${{ env.PACKAGE_VERSION }} \
319
340
--pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \
320
341
--pkgsource="${{ github.event.repository.html_url }}" \
321
- --requires="obs-studio,libqt5core5a,libqt5widgets5, libqt5network5,libqt5concurrent5,qt5-image-formats-plugins" \
342
+ --requires="obs-studio,libqt5network5,libqt5concurrent5,qt5-image-formats-plugins" \
322
343
--pakdir="../package"
323
344
sudo chmod ao+r ../package/*
345
+ sudo mv ../package/* ../package/${{ env.FILENAME }}
324
346
cd -
325
347
- name : ' Publish ${{ env.FILENAME }}'
326
348
if : success()
327
349
uses : actions/upload-artifact@v2-preview
328
350
with :
329
- name : ' ${{ env.GIT_HASH }}-Ubuntu64'
330
- path : ' ${{ github.workspace }}/obs-websocket/package/*.deb'
351
+ name : ' obs-websocket- ${{ env.PACKAGE_VERSION }}-Ubuntu64'
352
+ path : ' ${{ github.workspace }}/obs-websocket/package/*.deb'
0 commit comments