Skip to content

chore: prepare for v1.18.4 (#867) #377

chore: prepare for v1.18.4 (#867)

chore: prepare for v1.18.4 (#867) #377

Workflow file for this run

name: Build PPA source packages
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
environment:
name: ppa
strategy:
fail-fast: false
matrix:
target:
- jammy
- noble
- plucky
- questing
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Setup dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq debhelper devscripts gnupg
# Note for future maintainers: the secret key should be stored
# in the GHA secret in ASCII-armored form, and must not be
# password-protected.
- name: Setup GPG signing key
env:
PPA_SECRET_KEY: ${{ secrets.PPA_SECRET_KEY }}
run: |
echo "$PPA_SECRET_KEY" > private-key.asc
gpg --import --batch private-key.asc
rm -f private-key.asc
- name: Build source package
env:
DEBFULLNAME: "Github Actions"
DEBEMAIL: "[email protected]"
TARGET: ${{ matrix.target }}
run: |
# Get the version from configure.ac
BUILD_VERSION=$(autoconf --trace="AC_INIT:\$2" 2>/dev/null)
# Find the base commit where this version was introduced
BASE_COMMIT=""
for commit in $(git rev-list HEAD -- configure.ac); do
if [ "$(git show "$commit:configure.ac" | autoconf --trace="AC_INIT:\$2" - 2>/dev/null)" == "${BUILD_VERSION}" ]; then
BASE_COMMIT="$commit"
else
break
fi
done
# Format the version string witout relying on git tags
COMMIT_COUNT=$(git rev-list --count "${BASE_COMMIT}..HEAD")
SHORT_HASH=$(git rev-parse --short HEAD)
VERSION="${BUILD_VERSION}+git${COMMIT_COUNT}-g${SHORT_HASH}"
dch --create \
--distribution ${TARGET} \
--package dqlite1.18-unstable \
--newversion ${VERSION}~${TARGET}1 \
"Automatic build from Github"
debuild -S -sa -d -k${{ vars.PPA_PUBLIC_KEY }}
- name: Upload to Launchpad
run: |
(cd .. && dput -U -u ppa:dqlite/dev *.changes)