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: when:
event: tag event: tag
@ -26,6 +21,13 @@ steps:
commands: commands:
- go mod vendor - go mod vendor
code-gen:
image: *golang_image
depends_on:
- vendor
commands:
- make generate
cross-compile-server: cross-compile-server:
depends_on: depends_on:
- vendor - vendor
@ -42,6 +44,14 @@ steps:
XGO_VERSION: *xgo_version XGO_VERSION: *xgo_version
TARGZ: '1' TARGZ: '1'
build-tarball:
depends_on:
- code-gen
- build-web
image: *golang_image
commands:
- make build-tarball
build-agent: build-agent:
depends_on: depends_on:
- vendor - vendor
@ -71,6 +81,7 @@ steps:
- build-agent - build-agent
- build-cli - build-cli
- build-deb-rpm - build-deb-rpm
- build-tarball
image: *golang_image image: *golang_image
commands: commands:
- make release-checksums - make release-checksums

View file

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

View file

@ -196,6 +196,17 @@ build-agent: ## Build agent
build-cli: ## Build cli 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 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 .PHONY: build
build: build-agent build-server build-cli ## Build all binaries build: build-agent build-server build-cli ## Build all binaries