46 lines
2.2 KiB
YAML
46 lines
2.2 KiB
YAML
---
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
|
|
build_debian:
|
|
runs-on: docker
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Build package
|
|
run: |
|
|
apt update; apt install -y lintian sudo curl git make golang-go
|
|
make prometheus-dnssec-exporter
|
|
export EXPORTER_VERSION=$(git describe --tags --dirty | sed -re s/^v// | cut -d- -f1)
|
|
mkdir -p package/debian/prometheus-dnssec-exporter/usr/share/doc/prometheus-dnssec-exporter
|
|
(for ref in $(git tag --sort=-refname | grep -v v0.0.0); do
|
|
echo -e "prometheus-dnssec-exporter ($(echo "${ref}" | sed -re s/^v//)) stable; urgency=medium\n"
|
|
git log --format=' * %s' "$(git describe --tags --abbrev=0 ${ref}^)..${ref}"
|
|
DATE="$(git log --tags --simplify-by-decoration --pretty='format:%aD' "${ref}^..${ref}" | tail -1)"
|
|
echo -e "\n -- s3lph <s3lph@kabelsalat.ch> ${DATE}\n"
|
|
done) > package/debian/prometheus-dnssec-exporter/usr/share/doc/prometheus-dnssec-exporter/changelog
|
|
gzip -9n package/debian/prometheus-dnssec-exporter/usr/share/doc/prometheus-dnssec-exporter/changelog
|
|
mkdir -p package/debian/prometheus-dnssec-exporter/usr/bin
|
|
cp prometheus-dnssec-exporter package/debian/prometheus-dnssec-exporter/usr/bin
|
|
cd package/debian/prometheus-dnssec-exporter
|
|
find . -exec chown root:root {} \;
|
|
find . -type f -exec chmod 0644 {} \;
|
|
find . -type d -exec chmod 755 {} \;
|
|
chmod +x usr/bin/prometheus-dnssec-exporter DEBIAN/postinst DEBIAN/prerm
|
|
sed -re "s/__VERSION__/${EXPORTER_VERSION}-1/g" -i DEBIAN/control
|
|
cd ..
|
|
dpkg-deb --build prometheus-dnssec-exporter
|
|
mv "prometheus-dnssec-exporter.deb" "prometheus-dnssec-exporter_${EXPORTER_VERSION}-1_all.deb"
|
|
sudo -u nobody lintian "prometheus-dnssec-exporter_${EXPORTER_VERSION}-1_all.deb" || true
|
|
|
|
- uses: https://git.kabelsalat.ch/s3lph/forgejo-action-debian-package-upload@v2
|
|
with:
|
|
username: ${{ secrets.API_USERNAME }}
|
|
password: ${{ secrets.API_PASSWORD }}
|
|
deb: "package/debian/*.deb"
|