prometheus-dnssec-exporter/.forgejo/workflows/package.yml
s3lph 54c3cb51a4
All checks were successful
/ build_debian (push) Successful in 2m0s
/ compile (push) Successful in 1m11s
/ golangci-lint (push) Successful in 2m3s
feat: migrate from woodpecker to forgejo actions
2023-12-19 06:24:38 +01:00

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"