| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- name: Publish to Ubuntu PPA
- on:
- workflow_dispatch:
- inputs:
- version:
- description: 'Package version (e.g. 2.4). Leave empty to use example.env.'
- required: false
- default: ''
- permissions:
- contents: read
- jobs:
- publish-ppa:
- name: Publish to PPA
- runs-on: ubuntu-latest
- steps:
- # ── 1. Checkout ──────────────────────────────────────────────────────
- - name: Checkout repository
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- # ── 2. Resolve package version ──────────────────────────────────────
- - name: Determine package version
- id: version
- run: |
- EXAMPLE_VERSION=$(grep -E '^\s*VERSION=' example.env | head -n1 | cut -d'=' -f2- | tr -d '"\r' | xargs || true)
- if [ -n "${{ github.event.inputs.version }}" ]; then
- VERSION="${{ github.event.inputs.version }}"
- elif [ -n "$EXAMPLE_VERSION" ]; then
- VERSION="$EXAMPLE_VERSION"
- else
- VERSION="0.0.0"
- fi
- echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- echo "Package version: ${VERSION}"
- # ── 3. Create source tarball ─────────────────────────────────────────
- - name: Create source tarball
- run: |
- VERSION="${{ steps.version.outputs.version }}"
- PKG_DIR="squidstats-${VERSION}"
- mkdir -p "ppa-build/${PKG_DIR}"
- rsync -a \
- --exclude='.git' \
- --exclude='debian' \
- --exclude='.github' \
- --exclude='.venv' \
- --exclude='__pycache__' \
- --exclude='*.pyc' \
- --exclude='*.session' \
- --exclude='.env' \
- --exclude='ppa-build' \
- --exclude='dist' \
- ./ "ppa-build/${PKG_DIR}/"
- mkdir -p ppa-build/tarball
- tar -czf "ppa-build/tarball/squidstats_${VERSION}.orig.tar.gz" \
- -C ppa-build "${PKG_DIR}"
- echo "=== Created tarball ==="
- ls -lh ppa-build/tarball/
- # ── 4. Prepare debian directory for PPA ─────────────────────────────
- # The action container runs Ubuntu focal (debhelper 12, python3 3.8).
- # Relax Build-Depends so mk-build-deps can install them inside the
- # container; the actual package is built on Launchpad servers (noble/
- # resolute) which have debhelper 13+ and python3 3.11+.
- - name: Prepare debian directory for PPA
- run: |
- cp -r debian ppa-debian
- sed -i 's/debhelper-compat (= 13)/debhelper (>= 12~)/' ppa-debian/control
- sed -i 's/python3 (>= 3\.11)/python3/' ppa-debian/control
- echo "12" > ppa-debian/compat
- echo "=== Build-Depends after fix ==="
- grep 'Build-Depends' ppa-debian/control
- # ── 5. Publish to PPA ────────────────────────────────────────────────
- - name: Publish to Ubuntu PPA
- uses: yuezk/publish-ppa-package@v2
- with:
- repository: kaelthasmanu/squidstats
- gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
- gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
- tarball: ppa-build/tarball/squidstats_${{ steps.version.outputs.version }}.orig.tar.gz
- debian_dir: ppa-debian
- deb_email: manuelalberto.gorrin@gmail.com
- deb_fullname: Manuel Alberto Gorrin Reyes
- series: "noble"
- # extra_series: "resolute" # enable once resolute is activated in the PPA settings
- debmake_arguments: '-b":python3"'
|