2022-01-29 12:58:55 +00:00
|
|
|
depends_on:
|
|
|
|
- test
|
|
|
|
- web
|
|
|
|
|
2022-07-17 16:25:56 +00:00
|
|
|
variables:
|
2023-03-20 23:48:15 +00:00
|
|
|
- &golang_image 'golang:1.20.2'
|
2022-10-25 12:51:29 +00:00
|
|
|
- &node_image 'node:18-alpine'
|
2022-07-17 16:25:56 +00:00
|
|
|
- &when_path
|
|
|
|
# related config files
|
|
|
|
- ".woodpecker/binaries.yml"
|
|
|
|
- "nfpm/*.yml"
|
|
|
|
# go source code
|
|
|
|
- "**/*.go"
|
|
|
|
- "go.*"
|
|
|
|
# web source code
|
|
|
|
- "web/**"
|
|
|
|
|
2022-01-29 12:58:55 +00:00
|
|
|
pipeline:
|
2022-06-16 21:55:17 +00:00
|
|
|
build-web:
|
2022-06-16 23:57:02 +00:00
|
|
|
group: prepare
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *node_image
|
2022-10-25 12:51:29 +00:00
|
|
|
directory: web/
|
2022-01-29 12:58:55 +00:00
|
|
|
commands:
|
2022-10-08 14:15:07 +00:00
|
|
|
- corepack enable
|
|
|
|
- pnpm install --frozen-lockfile
|
|
|
|
- pnpm build
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-01-29 12:58:55 +00:00
|
|
|
|
2022-06-16 23:57:02 +00:00
|
|
|
vendor:
|
|
|
|
group: prepare
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *golang_image
|
2022-06-16 23:57:02 +00:00
|
|
|
commands:
|
|
|
|
- go mod vendor
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-06-16 23:57:02 +00:00
|
|
|
|
2022-01-29 12:58:55 +00:00
|
|
|
build-server:
|
|
|
|
group: build
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *golang_image
|
2022-01-29 12:58:55 +00:00
|
|
|
commands:
|
|
|
|
- make release-server
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-01-29 12:58:55 +00:00
|
|
|
|
|
|
|
build-agent:
|
|
|
|
group: build
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *golang_image
|
2022-01-29 12:58:55 +00:00
|
|
|
commands:
|
|
|
|
- make release-agent
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-01-29 12:58:55 +00:00
|
|
|
|
|
|
|
build-cli:
|
|
|
|
group: build
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *golang_image
|
2022-01-29 12:58:55 +00:00
|
|
|
commands:
|
|
|
|
- make release-cli
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-01-29 12:58:55 +00:00
|
|
|
|
|
|
|
build-deb-rpm:
|
|
|
|
group: bundle
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *golang_image
|
2022-01-29 12:58:55 +00:00
|
|
|
commands:
|
|
|
|
- make bundle
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-01-29 12:58:55 +00:00
|
|
|
|
2022-06-16 23:57:02 +00:00
|
|
|
build-tarball:
|
|
|
|
group: bundle
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *golang_image
|
2022-06-16 23:57:02 +00:00
|
|
|
commands:
|
|
|
|
- make release-tarball
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-06-16 23:57:02 +00:00
|
|
|
|
2022-01-29 12:58:55 +00:00
|
|
|
checksums:
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *golang_image
|
2022-01-29 12:58:55 +00:00
|
|
|
commands:
|
|
|
|
- make release-checksums
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-01-29 12:58:55 +00:00
|
|
|
|
|
|
|
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
|
|
|
|
|
|
|
|
release-dryrun:
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *golang_image
|
2022-01-29 12:58:55 +00:00
|
|
|
commands:
|
|
|
|
- ls -la dist/*.*
|
|
|
|
- cat dist/checksums.txt
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-01-29 12:58:55 +00: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
|