diff --git a/.fpm b/.fpm new file mode 100644 index 0000000..25a37c6 --- /dev/null +++ b/.fpm @@ -0,0 +1,6 @@ +-s dir +--name wireguard-gui +--license agpl3 +--description "Wireguard GUI is a graphic tool that helps you to edit existing confs of Wireguard." +--url "https://gitnet.fr/deblan/wireguard-gui" +--maintainer "Simon Vieille " diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml new file mode 100644 index 0000000..324bcc5 --- /dev/null +++ b/.woodpecker/build.yml @@ -0,0 +1,42 @@ +when: + - event: [pull_request, tag] + - event: push + branch: + - ${CI_REPO_DEFAULT_BRANCH} + - develop + - feature/* + - release/* + - renovate/* + +variables: + - &golang_image 'golang:1.22' + +steps: + "Add vendor": + image: *golang_image + commands: + - go mod vendor + + "Run build": + image: *golang_image + 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: + api_key: + from_secret: gitnet_api_key + base_url: https://gitnet.fr + files: ./build/* + when: + event: [tag] diff --git a/bin/build-debs.sh b/bin/build-debs.sh new file mode 100755 index 0000000..cd54bae --- /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/wireguard-gui-$VERSION-$ARCH.deb" \ + --architecture $ARCH --version "$VERSION" \ + "build/wireguard-gui-linux-$ARCH"=/usr/bin/wireguard-gui +done diff --git a/bin/rename-builds.sh b/bin/rename-builds.sh new file mode 100755 index 0000000..6f1f79e --- /dev/null +++ b/bin/rename-builds.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +VERSION="$1" + +for ARCH in amd64 arm64; do + mv -v \ + "build/wireguard-gui-linux-${ARCH}" \ + "build/wireguard-gui-${VERSION}-linux-${ARCH}" +done