From 2e21137d5a70056d4324d9ee5f03d4f798e49d60 Mon Sep 17 00:00:00 2001 From: Georg Sieber Date: Wed, 27 Dec 2023 00:22:17 +0100 Subject: [PATCH] add github build workflow --- .github/workflows/build_packages.yml | 58 ++++++++++++++++++++++++++++ installer/debian/debian/control | 2 +- installer/debian/debian/rules | 2 +- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build_packages.yml diff --git a/.github/workflows/build_packages.yml b/.github/workflows/build_packages.yml new file mode 100644 index 0000000..d9aecd3 --- /dev/null +++ b/.github/workflows/build_packages.yml @@ -0,0 +1,58 @@ +name: Release with packages + +on: + workflow_dispatch: # allow manual execution + push: + tags: + - 'v*' + +jobs: + create_release: # used to identify the output in other jobs + name: Create Release + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Get version name + run: echo "VERSION=Version $(python3 -c 'import simple_signer; print(simple_signer.__version__)')" >> $GITHUB_ENV + - id: create_release + name: Create Github release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this token is provided automatically by Actions with permissions declared above + with: + draft: true + prerelease: false + release_name: ${{ env.VERSION }} + tag_name: ${{ github.ref }} + + debian_package: + name: Create .deb for Python 3.10 (Ubuntu 22.04) + needs: create_release + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install dependencies + run: sudo apt install -y debhelper dh-virtualenv python3 python3-virtualenv python3-pip python3-setuptools python3-pyqt5 swig qttools5-dev-tools qtchooser + - name: Execute build + run: cd installer/debian/ && ./build.sh + - name: Get artifact + run: | + echo "ARTIFACT_PATH=$(find installer/ -name "*.deb")" >> $GITHUB_ENV + echo "ARTIFACT_NAME=$(basename $(find installer/ -name "*.deb") .deb)" >> $GITHUB_ENV + - name: Upload artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ needs.create_release.outputs.upload_url }} + asset_path: ${{ env.ARTIFACT_PATH }} + asset_name: ${{ env.ARTIFACT_NAME }}_python3.10_ubuntu22.04.deb + asset_content_type: application/vnd.debian.binary-package diff --git a/installer/debian/debian/control b/installer/debian/debian/control index ef9b309..b358371 100644 --- a/installer/debian/debian/control +++ b/installer/debian/debian/control @@ -2,7 +2,7 @@ Source: simple-signer Section: python Priority: optional Maintainer: Georg Sieber -Build-Depends: debhelper (>= 9), dh-virtualenv (>= 0.8), python3, python3-pip, python3-setuptools, python3-pyqt5, swig, qtchooser +Build-Depends: debhelper (>= 9), dh-virtualenv (>= 0.8), python3, python3-virtualenv, python3-pip, python3-setuptools, python3-pyqt5, swig, qttools5-dev-tools, qtchooser Standards-Version: 3.9.5 Package: simple-signer diff --git a/installer/debian/debian/rules b/installer/debian/debian/rules index 7d6fd0b..4c6ca30 100755 --- a/installer/debian/debian/rules +++ b/installer/debian/debian/rules @@ -9,7 +9,7 @@ export DH_VIRTUALENV_INSTALL_ROOT=/usr/share # * execute the Makefile in repo root to create QT translation files .PHONY: build build: - make ../.. + make -C ../.. # * exclude libfreetype due to dh_strip "string table error" .PHONY: override_dh_strip