From 87cb3afb2315c6578e49ba7080f219ef38bdc884 Mon Sep 17 00:00:00 2001 From: Apostolos Chalis <93685610+TolisSth@users.noreply.github.com> Date: Mon, 27 Jul 2026 14:56:36 +0300 Subject: [PATCH] Add GitHub Actions workflow for PPA publishing This workflow automates the process of publishing a Debian package to a Launchpad PPA upon tagging a release or manually triggering it. --- .github/workflows/publish_to_PPA.yml | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/publish_to_PPA.yml diff --git a/.github/workflows/publish_to_PPA.yml b/.github/workflows/publish_to_PPA.yml new file mode 100644 index 0000000..7f549f3 --- /dev/null +++ b/.github/workflows/publish_to_PPA.yml @@ -0,0 +1,62 @@ +name: Publish to Launchpad PPA + +on: + push: + tags: + - 'v*' # Triggers on tags like v1.0.0, v1.2.3-1, etc. + workflow_dispatch: # Allows manual trigger from GitHub UI + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + env: + # UPDATE THESE VARIABLES + PPA_TARGET: "ppa:your-launchpad-handle/your-ppa-name" + MAINTAINER_NAME: "Apostolos Chalis" + MAINTAINER_EMAIL: "achalis@csd.auth.gr" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Debian packaging tools + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + devscripts \ + debhelper \ + dh-make \ + dput \ + gnupg + + - name: Import GPG key for signing + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.chalis_ppa_key }} + passphrase: ${{ secrets.chalis_ppa_key }} + + - name: Configure Git and Debian environment + run: | + git config user.name "$MAINTAINER_NAME" + git config user.email "$MAINTAINER_EMAIL" + export DEBFULLNAME="$MAINTAINER_NAME" + export DEBEMAIL="$MAINTAINER_EMAIL" + + - name: Build Debian Source Package + run: | + # Clean untracked files that might interfere with debuild + git clean -fdx -e .github + + # Build source package (-S) and include upstream tarball (-sa) + # -k specifies the key ID/email to use for signing + debuild -S -sa -k"$MAINTAINER_EMAIL" + + - name: Upload to Launchpad PPA via dput + run: | + # Find the generated .changes file in the parent directory + CHANGES_FILE=$(ls ../*_source.changes | head -n 1) + + echo "Uploading $CHANGES_FILE to $PPA_TARGET..." + dput -f "$PPA_TARGET" "$CHANGES_FILE"