2022-01-29 14:58:55 +02:00
|
|
|
depends_on:
|
|
|
|
- test
|
|
|
|
- web
|
|
|
|
|
2022-07-17 18:25:56 +02:00
|
|
|
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/**"
|
|
|
|
|
2022-01-29 14:58:55 +02:00
|
|
|
pipeline:
|
2022-06-16 23:55:17 +02:00
|
|
|
build-web:
|
2022-06-17 01:57:02 +02:00
|
|
|
group: prepare
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2022-01-29 14:58:55 +02:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn install --frozen-lockfile
|
|
|
|
- yarn build
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-01-29 14:58:55 +02:00
|
|
|
|
2022-06-17 01:57:02 +02:00
|
|
|
vendor:
|
|
|
|
group: prepare
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *golang_image
|
2022-06-17 01:57:02 +02:00
|
|
|
commands:
|
|
|
|
- go mod vendor
|
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-06-17 01:57:02 +02:00
|
|
|
|
2022-01-29 14:58:55 +02:00
|
|
|
build-server:
|
|
|
|
group: build
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *golang_image
|
2022-01-29 14:58:55 +02:00
|
|
|
commands:
|
|
|
|
- make release-server
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-01-29 14:58:55 +02:00
|
|
|
|
|
|
|
build-agent:
|
|
|
|
group: build
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *golang_image
|
2022-01-29 14:58:55 +02:00
|
|
|
commands:
|
|
|
|
- make release-agent
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-01-29 14:58:55 +02:00
|
|
|
|
|
|
|
build-cli:
|
|
|
|
group: build
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *golang_image
|
2022-01-29 14:58:55 +02:00
|
|
|
commands:
|
|
|
|
- make release-cli
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-01-29 14:58:55 +02:00
|
|
|
|
|
|
|
build-deb-rpm:
|
|
|
|
group: bundle
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *golang_image
|
2022-01-29 14:58:55 +02:00
|
|
|
commands:
|
|
|
|
- make bundle
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-01-29 14:58:55 +02:00
|
|
|
|
2022-06-17 01:57:02 +02:00
|
|
|
build-tarball:
|
|
|
|
group: bundle
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *golang_image
|
2022-06-17 01:57:02 +02:00
|
|
|
commands:
|
|
|
|
- make release-tarball
|
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-06-17 01:57:02 +02:00
|
|
|
|
2022-01-29 14:58:55 +02:00
|
|
|
checksums:
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *golang_image
|
2022-01-29 14:58:55 +02:00
|
|
|
commands:
|
|
|
|
- make release-checksums
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-01-29 14:58:55 +02:00
|
|
|
|
|
|
|
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
|
|
|
|
|
|
|
|
release-dryrun:
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *golang_image
|
2022-01-29 14:58:55 +02:00
|
|
|
commands:
|
|
|
|
- ls -la dist/*.*
|
|
|
|
- cat dist/checksums.txt
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2022-01-29 14:58:55 +02:00
|
|
|
|
|
|
|
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
|