From e6118af9f378180281513d0887ed211e3a17162d Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Thu, 26 May 2022 14:05:59 +0800 Subject: [PATCH] ci: verify debian package --- .github/workflows/build.yml | 32 ++++++++++++++++++++------------ scripts/verify-debian-package.sh | 17 +++++++++++++++++ 2 files changed, 37 insertions(+), 12 deletions(-) create mode 100755 scripts/verify-debian-package.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ead7702..c7a4225 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04] - + runs-on: ${{ matrix.os }} steps: @@ -42,16 +42,20 @@ jobs: with: submodules: recursive fetch-depth: 0 - + - name: Install dependencies run: | python -m pip install --upgrade pip pip install git-archive-all - + - name: Archive all run: | ./scripts/snapshot-archive-all.sh + - name: Verify debian package + run: | + ./scripts/verify-debian-package.sh + - uses: actions/upload-artifact@v2 with: name: snapshot-source-code @@ -67,7 +71,7 @@ jobs: with: name: snapshot-source-code path: artifacts - + - name: Extract source code run: | cd $GITHUB_WORKSPACE/artifacts @@ -81,7 +85,7 @@ jobs: gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }} gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }} pkgdir: '${{ github.workspace }}/artifacts/deb-build/globalprotect-openconnect*/' - + snapshot-aur: if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }} needs: snapshot-archive-all @@ -135,14 +139,14 @@ jobs: with: name: snapshot-source-code path: artifacts - + - name: Extract source code run: | mkdir snap-source tar xvf ./artifacts/globalprotect-openconnect-*tar.gz \ --directory snap-source \ --strip 1 - + - uses: snapcore/action-build@v1 id: build with: @@ -164,16 +168,20 @@ jobs: with: submodules: recursive fetch-depth: 0 - + - name: Install dependencies run: | python -m pip install --upgrade pip pip install git-archive-all - + - name: Archive all run: | ./scripts/release-archive-all.sh + - name: Verify debian package + run: | + ./scripts/verify-debian-package.sh + - uses: actions/upload-artifact@v2 with: name: release-source-code @@ -203,7 +211,7 @@ jobs: gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }} gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }} pkgdir: '${{ github.workspace }}/artifacts/deb-build/globalprotect-openconnect*/' - + release-aur: if: startsWith(github.ref, 'refs/tags/v') needs: release-archive-all @@ -226,7 +234,7 @@ jobs: commit_email: ${{ secrets.AUR_EMAIL }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} commit_message: 'Release ${{ github.ref }}' - + release-obs: if: startsWith(github.ref, 'refs/tags/v') needs: release-archive-all @@ -245,7 +253,7 @@ jobs: username: yuezk password: ${{ secrets.OBS_PASSWORD }} files: ./artifacts/obs/* - + release-github: if: startsWith(github.ref, 'refs/tags/v') needs: diff --git a/scripts/verify-debian-package.sh b/scripts/verify-debian-package.sh new file mode 100755 index 0000000..bb0b8e7 --- /dev/null +++ b/scripts/verify-debian-package.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e + +sudo apt update +sudo apt install -y \ + build-essential \ + qtbase5-dev \ + libqt5websockets5-dev \ + qtwebengine5-dev \ + cmake \ + debhelper + +mkdir -p build + +cp ./artifacts/*.tar.gz build/ && cd build +tar -xzf *.tar.gz && cd globalprotect-openconnect-* + +dpkg-buildpackage -us -uc