Build tarball for distribution packages (#3244)

close  #3219

and also make sure the `binaries` & `docker` workflow will run on tag
events, see https://ci.woodpecker-ci.org/repos/3780/pipeline/12358
This commit is contained in:
6543 2024-01-21 22:18:20 +01:00 committed by GitHub
parent 8ca51971be
commit 9e862ae44b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 9 deletions

View file

@ -1,8 +1,3 @@
depends_on:
- test
- web
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
when:
event: tag
@ -26,6 +21,13 @@ steps:
commands:
- go mod vendor
code-gen:
image: *golang_image
depends_on:
- vendor
commands:
- make generate
cross-compile-server:
depends_on:
- vendor
@ -42,6 +44,14 @@ steps:
XGO_VERSION: *xgo_version
TARGZ: '1'
build-tarball:
depends_on:
- code-gen
- build-web
image: *golang_image
commands:
- make build-tarball
build-agent:
depends_on:
- vendor
@ -71,6 +81,7 @@ steps:
- build-agent
- build-cli
- build-deb-rpm
- build-tarball
image: *golang_image
commands:
- make release-checksums

View file

@ -6,10 +6,6 @@ when:
- release/*
- renovate/*
depends_on:
- test
- web
variables:
- &golang_image 'docker.io/golang:1.21.6'
- &node_image 'docker.io/node:21-alpine'

View file

@ -196,6 +196,17 @@ build-agent: ## Build agent
build-cli: ## Build cli
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags '${LDFLAGS}' -o dist/woodpecker-cli${BIN_SUFFIX} go.woodpecker-ci.org/woodpecker/v2/cmd/cli
build-tarball: ## Build tar archive
mkdir -p dist && tar chzvf dist/woodpecker-src.tar.gz \
--exclude="*.exe" \
--exclude="./.pnpm-store" \
--exclude="node_modules" \
--exclude="./dist" \
--exclude="./data" \
--exclude="./build" \
--exclude="./.git" \
.
.PHONY: build
build: build-agent build-server build-cli ## Build all binaries