From 262980c36e30da3da0a97a481d96de6356794c1b Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 24 Jul 2024 11:38:33 +0200 Subject: [PATCH] add debian packaging rename builds to include the version --- .fpm | 6 ++++++ .woodpecker/build.yml | 9 +++++++++ bin/build-debs.sh | 9 +++++++++ bin/rename-builds.sh | 17 +++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 .fpm create mode 100755 bin/build-debs.sh create mode 100755 bin/rename-builds.sh diff --git a/.fpm b/.fpm new file mode 100644 index 0000000..b4a14af --- /dev/null +++ b/.fpm @@ -0,0 +1,6 @@ +-s dir +--name expiration-check +--license agpl3 +--description "Checks the expiration dates of domains and certificates" +--url "https://gitnet.fr/deblan/expiration-check" +--maintainer "Simon Vieille " diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml index 262c2ff..bbcaea1 100644 --- a/.woodpecker/build.yml +++ b/.woodpecker/build.yml @@ -21,6 +21,15 @@ steps: commands: - make + "Create packages": + image: deblan/fpm-packager + commands: + - VERSION=${CI_COMMIT_TAG/v//} + - ./bin/build-debs.sh "$VERSION" + - ./bin/rename-builds.sh "$VERSION" + when: + event: [tag] + "Publish": image: plugins/gitea-release settings: diff --git a/bin/build-debs.sh b/bin/build-debs.sh new file mode 100755 index 0000000..ed69cbb --- /dev/null +++ b/bin/build-debs.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +VERSION="$1" + +for ARCH in amd64 arm64; do + fpm -t deb -p "build/expiration-check-$VERSION-$ARCH.deb" \ + --architecture $ARCH --version "$VERSION" \ + "build/expiration-check-linux-$ARCH"=/usr/bin/expiration-check +done diff --git a/bin/rename-builds.sh b/bin/rename-builds.sh new file mode 100755 index 0000000..ef1276c --- /dev/null +++ b/bin/rename-builds.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +VERSION="$1" + +for OS in linux windows darwin; do + if [ "$OS" = "windows" ]; then + EXTENSION=".exe" + else + EXTENSION= + fi + + for ARCH in amd64 arm64; do + mv -v \ + "build/expiration-check-${OS}-${ARCH}${EXTENSION}" \ + "build/expiration-check-${VERSION}-${OS}-${ARCH}${EXTENSION}" + done +done