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