mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 11:51:02 +00:00
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:
parent
8ca51971be
commit
9e862ae44b
3 changed files with 27 additions and 9 deletions
|
@ -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
|
||||||
|
|
|
@ -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'
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue