mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-29 21:31:02 +00:00
8da0ee47f7
use yaml aliases (https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases) to have pipeline `variables` Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com> Co-authored-by: Anbraten <anton@ju60.de>
108 lines
1.9 KiB
YAML
108 lines
1.9 KiB
YAML
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/**"
|
|
|
|
pipeline:
|
|
build-web:
|
|
group: prepare
|
|
image: *node_image
|
|
commands:
|
|
- cd web/
|
|
- yarn install --frozen-lockfile
|
|
- yarn build
|
|
when:
|
|
path: *when_path
|
|
|
|
vendor:
|
|
group: prepare
|
|
image: *golang_image
|
|
commands:
|
|
- go mod vendor
|
|
when:
|
|
path: *when_path
|
|
|
|
build-server:
|
|
group: build
|
|
image: *golang_image
|
|
commands:
|
|
- make release-server
|
|
when:
|
|
path: *when_path
|
|
|
|
build-agent:
|
|
group: build
|
|
image: *golang_image
|
|
commands:
|
|
- make release-agent
|
|
when:
|
|
path: *when_path
|
|
|
|
build-cli:
|
|
group: build
|
|
image: *golang_image
|
|
commands:
|
|
- make release-cli
|
|
when:
|
|
path: *when_path
|
|
|
|
build-deb-rpm:
|
|
group: bundle
|
|
image: *golang_image
|
|
commands:
|
|
- make bundle
|
|
when:
|
|
path: *when_path
|
|
|
|
build-tarball:
|
|
group: bundle
|
|
image: *golang_image
|
|
commands:
|
|
- make release-tarball
|
|
when:
|
|
path: *when_path
|
|
|
|
checksums:
|
|
image: *golang_image
|
|
commands:
|
|
- make release-checksums
|
|
when:
|
|
path: *when_path
|
|
|
|
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
|
|
|
|
release-dryrun:
|
|
image: *golang_image
|
|
commands:
|
|
- ls -la dist/*.*
|
|
- cat dist/checksums.txt
|
|
when:
|
|
path: *when_path
|
|
|
|
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
|
|
# path conditions are ignored for tag events
|