woodpecker/.woodpecker/binaries.yml

99 lines
1.8 KiB
YAML
Raw Normal View History

depends_on:
- test
- web
variables:
- &golang_image 'golang:1.18'
- &node_image 'node:16-alpine'
- &when_path
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
when:
- event: push
branch: ["${CI_REPO_DEFAULT_BRANCH}", "release/*" ]
path: *when_path
- event: tag
- event: pull_request # TODO: Do we need this :thinking:?
path: *when_path
pipeline:
build-web:
group: prepare
image: *node_image
commands:
- cd web/
- corepack enable
- pnpm install --frozen-lockfile
- pnpm build
vendor:
group: prepare
image: *golang_image
commands:
- go mod vendor
build-server:
group: build
image: *golang_image
commands:
- make release-server
build-agent:
group: build
image: *golang_image
commands:
- make release-agent
build-cli:
group: build
image: *golang_image
commands:
- make release-cli
build-deb-rpm:
group: bundle
image: *golang_image
commands:
- make bundle
build-tarball:
group: bundle
image: *golang_image
commands:
- make release-tarball
checksums:
image: *golang_image
commands:
- make release-checksums
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
release-dryrun:
image: *golang_image
commands:
- ls -la dist/*.*
- cat dist/checksums.txt
release:
image: plugins/github-release
secrets:
- source: github_token
target: github_release_api_key
settings:
files:
- dist/*.tar.gz
- dist/*.deb
- dist/*.rpm
- dist/checksums.txt
title: ${CI_COMMIT_TAG##v}
when:
event: tag