From ad0b7c396650916ab3e273e7f2ff82e4e290fdd6 Mon Sep 17 00:00:00 2001 From: Simon Bernier St-Pierre Date: Sun, 12 Jul 2026 09:13:55 -0400 Subject: [PATCH] add CI files to build & release --- .woodpecker/build.yml | 11 +++++++++++ .woodpecker/release.yml | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .woodpecker/build.yml create mode 100644 .woodpecker/release.yml diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml new file mode 100644 index 0000000..6c73150 --- /dev/null +++ b/.woodpecker/build.yml @@ -0,0 +1,11 @@ +when: + - event: [push, pull_request] + branch: [main, master] + +steps: + build: + image: golang:1.26-alpine3.23 + commands: + - go mod download + - CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o /dev/null ./... + - echo "Build successful" diff --git a/.woodpecker/release.yml b/.woodpecker/release.yml new file mode 100644 index 0000000..060c8a4 --- /dev/null +++ b/.woodpecker/release.yml @@ -0,0 +1,24 @@ +when: + - event: tag + +steps: + build: + image: golang:1.26-alpine3.23 + commands: + - go mod download + - CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o qbittorrent-sentinel + + publish: + image: alpine:3.23 + commands: + - apk add --no-cache curl + - | + echo "Uploading qbittorrent-sentinel..." + curl -sS -X POST \ + -H "Authorization: token $GITEA_RELEASE_TOKEN" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@qbittorrent-sentinel" \ + "https://git.sbstp.ca/api/v1/repos/${CI_REPO}/releases/tags/${CI_COMMIT_TAG}/assets?name=qbittorrent-sentinel" + environment: + GITEA_RELEASE_TOKEN: + from_secret: gitea_release_token