From 32bb8340d032635da80f2c0287e568023e72589b Mon Sep 17 00:00:00 2001 From: Ricardo <10128951+smplayer-dev@users.noreply.github.com> Date: Wed, 21 Apr 2021 14:39:02 +0200 Subject: [PATCH] Add build-ubuntu-packages.yml --- .github/workflows/build-ubuntu-packages.yml | 75 +++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/build-ubuntu-packages.yml diff --git a/.github/workflows/build-ubuntu-packages.yml b/.github/workflows/build-ubuntu-packages.yml new file mode 100644 index 0000000..52e0d1e --- /dev/null +++ b/.github/workflows/build-ubuntu-packages.yml @@ -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