| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- name: Publish to Ubuntu PPA
- on:
- workflow_dispatch:
- inputs:
- version:
- description: 'Package version (e.g. 2.6.1). Leave empty to use example.env.'
- required: false
- default: ''
- revision:
- description: 'Revision for the PPA upload (e.g. 2 for ppa2).'
- required: false
- default: '1'
- permissions:
- contents: read
- jobs:
- publish-ppa:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@v7
- - 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
- echo "Unable to determine version"
- exit 1
- fi
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- - name: Create source tarball
- run: |
- VERSION="${{ steps.version.outputs.version }}"
- PKG_DIR="squidstats-${VERSION}"
- mkdir -p build/${PKG_DIR}
- rsync -a \
- --exclude='.git' \
- --exclude='.github' \
- --exclude='debian' \
- --exclude='.venv' \
- --exclude='__pycache__' \
- --exclude='*.pyc' \
- --exclude='*.session' \
- --exclude='.env' \
- --exclude='build' \
- --exclude='dist' \
- ./ build/${PKG_DIR}/
- mkdir -p build/tarball
- tar -czf \
- build/tarball/squidstats_${VERSION}.orig.tar.gz \
- -C build \
- ${PKG_DIR}
- - name: Prepare Debian directory
- run: |
- cp -r debian build/debian
- sed -i 's/debhelper-compat (= 13)/debhelper (>= 12~)/' build/debian/control
- sed -i 's/python3 (>= 3\.11)/python3/' build/debian/control
- echo "12" > build/debian/compat
- - 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: build/tarball/squidstats_${{ steps.version.outputs.version }}.orig.tar.gz
- debian_dir: build/debian
- deb_email: manuelalberto.gorrin@gmail.com
- deb_fullname: Manuel Alberto Gorrin Reyes
- series: "noble"
- revision: ${{ github.event.inputs.revision }}
- # extra_series: "resolute" # enable once resolute is activated in the PPA settings
- debmake_arguments: '-b":python3"'
|