Merge pull request #328 from canonical/dependabot/go_modules/master/g… #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build PPA source packages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
if: github.repository == 'canonical/go-dqlite' | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- focal | |
- jammy | |
- noble | |
- oracular | |
runs-on: ubuntu-20.04 | |
environment: | |
name: ppa | |
steps: | |
- name: Clone the repositories | |
run: | | |
git clone https://github.com/canonical/go-dqlite | |
git clone https://github.com/canonical/dqlite-ppa -b go-dqlite --depth 1 | |
- name: Setup dependencies | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -qq debhelper devscripts dh-golang gnupg | |
- 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 | |
- name: Delete GPG signing key file | |
if: always() | |
run: | | |
rm -f private-key.asc | |
- name: Build source package | |
env: | |
DEBFULLNAME: "Github Actions" | |
DEBEMAIL: "dqlitebot@lists.canonical.com" | |
TARGET: ${{ matrix.target }} | |
run: | | |
cp -R dqlite-ppa/debian go-dqlite/ | |
cd go-dqlite/ | |
go mod vendor | |
VERSION="$(git describe --tags | sed -e "s/^v//" -e "s/-/+git/")" | |
dch --create \ | |
--distribution ${TARGET} \ | |
--package go-dqlite \ | |
--newversion ${VERSION}~${TARGET}1 \ | |
"Automatic build from Github" | |
debuild -S -sa -d -k${{ vars.PPA_PUBLIC_KEY }} | |
- name: Upload to Launchpad | |
run: | | |
dput -U -u ppa:dqlite/dev *.changes |