Skip to content

Commit d7d6969

Browse files
committed
CI: Add release builds for Windows + Linux
Also updates badges on README
1 parent a37cfb3 commit d7d6969

File tree

2 files changed

+36
-14
lines changed

2 files changed

+36
-14
lines changed

.github/workflows/main.yml

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- 'docs/**'
77
branches:
88
- master
9+
tags:
10+
- '[45].[0-9]+.[0-9]+*'
911
pull_request:
1012
paths-ignore:
1113
- 'docs/**'
@@ -44,7 +46,6 @@ jobs:
4446
working-directory: ${{ github.workspace }}/obs-studio
4547
run: |
4648
git fetch --prune --unshallow
47-
echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
4849
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
4950
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
5051
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
@@ -58,9 +59,14 @@ jobs:
5859
working-directory: ${{ github.workspace }}/obs-websocket
5960
run: |
6061
git fetch --prune --unshallow
61-
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
6262
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
6363
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
6470
- name: 'Restore Cached Qt'
6571
id: qtcache
6672
uses: actions/cache@v2
@@ -156,7 +162,11 @@ jobs:
156162
- name: 'Set PR Artifact Filename'
157163
shell: bash
158164
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
160170
echo "WIN_FILENAME=$FILENAME" >> $GITHUB_ENV
161171
- name: 'Package obs-websocket'
162172
working-directory: ${{ github.workspace }}/obs-websocket
@@ -175,7 +185,7 @@ jobs:
175185
if: success()
176186
uses: actions/upload-artifact@v2-preview
177187
with:
178-
name: '${{ env.GIT_HASH }}-Windows-Installer'
188+
name: 'obs-websocket-${{ env.PACKAGE_VERSION }}-Windows-Installer'
179189
path: ${{ github.workspace }}/obs-websocket/package/*.exe
180190
ubuntu64:
181191
name: "Linux/Ubuntu 64-bit"
@@ -198,7 +208,6 @@ jobs:
198208
working-directory: ${{ github.workspace }}/obs-studio
199209
run: |
200210
git fetch --prune --unshallow
201-
echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
202211
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
203212
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
204213
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
@@ -211,9 +220,14 @@ jobs:
211220
working-directory: ${{ github.workspace }}/obs-websocket
212221
run: |
213222
git fetch --prune --unshallow
214-
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
215223
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
216224
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
217231
- name: 'Install prerequisites (Apt)'
218232
shell: bash
219233
run: |
@@ -294,7 +308,11 @@ jobs:
294308
run: |
295309
mkdir ./build
296310
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
298316
- name: 'Build obs-websocket'
299317
working-directory: ${{ github.workspace }}/obs-websocket
300318
shell: bash
@@ -305,26 +323,30 @@ jobs:
305323
- name: 'Set PR Artifact Filename'
306324
shell: bash
307325
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
309331
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
310332
- name: 'Package ${{ env.FILENAME }}'
311333
if: success()
312334
working-directory: ${{ github.workspace }}/obs-websocket
313335
shell: bash
314336
run: |
315-
VERSION="1-${{ env.GIT_HASH }}-git"
316337
cd ./build
317338
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 }} \
319340
--pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \
320341
--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" \
322343
--pakdir="../package"
323344
sudo chmod ao+r ../package/*
345+
sudo mv ../package/* ../package/${{ env.FILENAME }}
324346
cd -
325347
- name: 'Publish ${{ env.FILENAME }}'
326348
if: success()
327349
uses: actions/upload-artifact@v2-preview
328350
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'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
WebSockets API for OBS Studio.
1414

15-
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40LePalakis)](https://twitter.com/LePalakis)
15+
[![CI Multiplatform Build](https://github.com/Palakis/obs-websocket/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Palakis/obs-websocket/actions/workflows/main.yml)
1616
[![Discord](https://img.shields.io/discord/715691013825364120.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/WBaSQ3A)
1717
[![Financial Contributors on Open Collective](https://opencollective.com/obs-websocket/all/badge.svg?label=financial+contributors)](https://opencollective.com/obs-websocket)
1818

0 commit comments

Comments
 (0)