Skip to content

Commit

Permalink
Add build-ubuntu-packages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
smplayer-dev authored Apr 21, 2021
1 parent 7482d44 commit 32bb834
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-ubuntu-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build Ubuntu Packages
env:
app-name: 'smplayer-skins'
VERSION: '20.11.0'

on:
workflow_dispatch:
release:
types: [published]

jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- { name: 'xenial', os: 'ubuntu-16.04', qt: 4 }
- { name: 'bionic', os: 'ubuntu-18.04', qt: 5 }
- { name: 'focal', os: 'ubuntu-20.04', qt: 5 }

runs-on: ${{ matrix.config.os }}

steps:
- name: Install sources
uses: actions/checkout@v2
with:
path: ${{ env.app-name }}
#fetch-depth: 0

- name: Install development packages
run: |
sudo apt-get update
sudo apt-get install fakeroot build-essential devscripts debhelper
- name: Install Qt 4
run: sudo apt-get install libqt4-dev
if: ${{ matrix.config.qt == 4 }}

- name: Install Qt 5
run: |
sudo apt-get install qtbase5-dev-tools
echo "QT_SELECT=qt5" >> $GITHUB_ENV
if: ${{ matrix.config.qt == 5 }}

- name: Prepare sources
run: |
cd ${{ env.app-name }}
ln -s debian-orig debian
dch -b -v 2:$VERSION~${{ matrix.config.name }} "Automatic build"
- name: Compile ${{ env.app-name }}
run: cd ${{ env.app-name }} && fakeroot debian/rules build

- name: Build package
run: |
cd ${{ env.app-name }} && fakeroot debian/rules binary
cd ..
PACKAGEFILENAME=`ls ${{ env.app-name }}*.deb`
echo "PACKAGEFILENAME=$PACKAGEFILENAME" >> $GITHUB_ENV
- name: Create artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGEFILENAME }}
path: ./*.deb

- name: Upload package to release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./*.deb
tag: ${{ github.ref }}
overwrite: true
file_glob: true

0 comments on commit 32bb834

Please sign in to comment.