From 7725058f0398ef9729e2533858a9213b68f94613 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Wed, 20 Oct 2021 21:55:09 +0200 Subject: [PATCH] Release deb, rpm bundles (#405) --- .woodpecker/main.yml | 27 +++++++++++++++++++-------- Makefile | 17 +++++++++++++++++ docs/docs/80-downloads.md | 6 +----- nfpm/nfpm-agent.yml | 10 ++++++++++ nfpm/nfpm-cli.yml | 10 ++++++++++ nfpm/nfpm-server.yml | 10 ++++++++++ 6 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 nfpm/nfpm-agent.yml create mode 100644 nfpm/nfpm-cli.yml create mode 100644 nfpm/nfpm-server.yml diff --git a/.woodpecker/main.yml b/.woodpecker/main.yml index 47c79d66a..a8c8a7d10 100644 --- a/.woodpecker/main.yml +++ b/.woodpecker/main.yml @@ -62,8 +62,17 @@ pipeline: commands: - make release-cli + build-deb-rpm: + group: bundle + image: golang:1.16 + commands: + - make bundle + when: + event: [push, tag] + branch: master + publish-server: - group: docker + group: bundle image: plugins/docker repo: woodpeckerci/woodpecker-server dockerfile: docker/Dockerfile.server @@ -75,7 +84,7 @@ pipeline: event: push publish-server-alpine: - group: docker + group: bundle image: plugins/docker repo: woodpeckerci/woodpecker-server dockerfile: docker/Dockerfile.server.alpine @@ -87,7 +96,7 @@ pipeline: event: push publish-agent: - group: docker + group: bundle image: plugins/docker repo: woodpeckerci/woodpecker-agent dockerfile: docker/Dockerfile.agent @@ -99,7 +108,7 @@ pipeline: event: push publish-agent-alpine: - group: docker + group: bundle image: plugins/docker repo: woodpeckerci/woodpecker-agent dockerfile: docker/Dockerfile.agent.alpine @@ -133,7 +142,7 @@ pipeline: event: push release-server: - group: docker + group: bundle image: plugins/docker repo: woodpeckerci/woodpecker-server dockerfile: docker/Dockerfile.server @@ -143,7 +152,7 @@ pipeline: event: tag release-server-alpine: - group: docker + group: bundle image: plugins/docker repo: woodpeckerci/woodpecker-server dockerfile: docker/Dockerfile.server.alpine @@ -153,7 +162,7 @@ pipeline: event: tag release-agent: - group: docker + group: bundle image: plugins/docker repo: woodpeckerci/woodpecker-agent dockerfile: docker/Dockerfile.agent @@ -163,7 +172,7 @@ pipeline: event: tag release-agent-alpine: - group: docker + group: bundle image: plugins/docker repo: woodpeckerci/woodpecker-agent dockerfile: docker/Dockerfile.agent.alpine @@ -205,6 +214,8 @@ pipeline: image: plugins/github-release files: - dist/*.tar.gz + - dist/*.deb + - dist/*.rpm - dist/checksums.txt title: ${DRONE_TAG##v} secrets: diff --git a/Makefile b/Makefile index adde55839..7ef464829 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,23 @@ release-checksums: release: release-frontend release-server release-agent release-cli +bundle-prepare: + go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v1.10.3 + +bundle-agent: bundle-prepare + nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager deb + nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager rpm + +bundle-server: bundle-prepare + nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager deb + nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager rpm + +bundle-cli: bundle-prepare + nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager deb + nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager rpm + +bundle: bundle-agent bundle-server bundle-cli + .PHONY: version version: @echo ${VERSION} diff --git a/docs/docs/80-downloads.md b/docs/docs/80-downloads.md index f2195e5c5..f5fa810fe 100644 --- a/docs/docs/80-downloads.md +++ b/docs/docs/80-downloads.md @@ -1,6 +1,6 @@ # Downloads -## Binaries +## Binaries & DEB, RPM [Latest release](https://github.com/woodpecker-ci/woodpecker/releases/latest) @@ -24,7 +24,3 @@ docker pull woodpeckerci/woodpecker-agent:latest-alpine docker pull woodpeckerci/woodpecker-cli:latest docker pull woodpeckerci/woodpecker-cli:latest-alpine ``` - -## APK, DEB, RPM - -TODO diff --git a/nfpm/nfpm-agent.yml b/nfpm/nfpm-agent.yml new file mode 100644 index 000000000..b53bdc8b5 --- /dev/null +++ b/nfpm/nfpm-agent.yml @@ -0,0 +1,10 @@ +name: woodpecker-agent +arch: amd64 +platform: linux +version: v${WOODPECKER_VERSION} +description: Woodpecker Agent +homepage: https://github.com/woodpecker-ci/woodpecker +license: Apache 2.0 +contents: +- src: ./dist/agent/linux_amd64/woodpecker-agent + dst: /usr/local/bin/woodpecker-agent diff --git a/nfpm/nfpm-cli.yml b/nfpm/nfpm-cli.yml new file mode 100644 index 000000000..fee346a36 --- /dev/null +++ b/nfpm/nfpm-cli.yml @@ -0,0 +1,10 @@ +name: woodpecker-cli +arch: amd64 +platform: linux +version: v${WOODPECKER_VERSION} +description: Woodpecker CLI +homepage: https://github.com/woodpecker-ci/woodpecker +license: Apache 2.0 +contents: +- src: ./dist/cli/linux_amd64/woodpecker-cli + dst: /usr/local/bin/woodpecker diff --git a/nfpm/nfpm-server.yml b/nfpm/nfpm-server.yml new file mode 100644 index 000000000..08cb4bced --- /dev/null +++ b/nfpm/nfpm-server.yml @@ -0,0 +1,10 @@ +name: woodpecker-server +arch: amd64 +platform: linux +version: v${WOODPECKER_VERSION} +description: Woodpecker Server +homepage: https://github.com/woodpecker-ci/woodpecker +license: Apache 2.0 +contents: +- src: ./dist/server/linux_amd64/woodpecker-server + dst: /usr/local/bin/woodpecker-server