ci: verify debian package

This commit is contained in:
Kevin Yue 2022-05-26 14:05:59 +08:00
parent 108b4be3ec
commit e6118af9f3
2 changed files with 37 additions and 12 deletions

View File

@ -19,7 +19,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04] os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@ -42,16 +42,20 @@ jobs:
with: with:
submodules: recursive submodules: recursive
fetch-depth: 0 fetch-depth: 0
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install git-archive-all pip install git-archive-all
- name: Archive all - name: Archive all
run: | run: |
./scripts/snapshot-archive-all.sh ./scripts/snapshot-archive-all.sh
- name: Verify debian package
run: |
./scripts/verify-debian-package.sh
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: snapshot-source-code name: snapshot-source-code
@ -67,7 +71,7 @@ jobs:
with: with:
name: snapshot-source-code name: snapshot-source-code
path: artifacts path: artifacts
- name: Extract source code - name: Extract source code
run: | run: |
cd $GITHUB_WORKSPACE/artifacts cd $GITHUB_WORKSPACE/artifacts
@ -81,7 +85,7 @@ jobs:
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }} gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }} gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
pkgdir: '${{ github.workspace }}/artifacts/deb-build/globalprotect-openconnect*/' pkgdir: '${{ github.workspace }}/artifacts/deb-build/globalprotect-openconnect*/'
snapshot-aur: snapshot-aur:
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }} if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }}
needs: snapshot-archive-all needs: snapshot-archive-all
@ -135,14 +139,14 @@ jobs:
with: with:
name: snapshot-source-code name: snapshot-source-code
path: artifacts path: artifacts
- name: Extract source code - name: Extract source code
run: | run: |
mkdir snap-source mkdir snap-source
tar xvf ./artifacts/globalprotect-openconnect-*tar.gz \ tar xvf ./artifacts/globalprotect-openconnect-*tar.gz \
--directory snap-source \ --directory snap-source \
--strip 1 --strip 1
- uses: snapcore/action-build@v1 - uses: snapcore/action-build@v1
id: build id: build
with: with:
@ -164,16 +168,20 @@ jobs:
with: with:
submodules: recursive submodules: recursive
fetch-depth: 0 fetch-depth: 0
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install git-archive-all pip install git-archive-all
- name: Archive all - name: Archive all
run: | run: |
./scripts/release-archive-all.sh ./scripts/release-archive-all.sh
- name: Verify debian package
run: |
./scripts/verify-debian-package.sh
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: release-source-code name: release-source-code
@ -203,7 +211,7 @@ jobs:
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }} gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }} gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
pkgdir: '${{ github.workspace }}/artifacts/deb-build/globalprotect-openconnect*/' pkgdir: '${{ github.workspace }}/artifacts/deb-build/globalprotect-openconnect*/'
release-aur: release-aur:
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
needs: release-archive-all needs: release-archive-all
@ -226,7 +234,7 @@ jobs:
commit_email: ${{ secrets.AUR_EMAIL }} commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: 'Release ${{ github.ref }}' commit_message: 'Release ${{ github.ref }}'
release-obs: release-obs:
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
needs: release-archive-all needs: release-archive-all
@ -245,7 +253,7 @@ jobs:
username: yuezk username: yuezk
password: ${{ secrets.OBS_PASSWORD }} password: ${{ secrets.OBS_PASSWORD }}
files: ./artifacts/obs/* files: ./artifacts/obs/*
release-github: release-github:
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
needs: needs:

View File

@ -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