Optimize pipeline and switch to "steps" (#1901)

This commit is contained in:
6543 2023-06-30 13:32:17 +02:00 committed by GitHub
parent 44b54db475
commit 3f534cfff6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 44 deletions

View file

@ -2,20 +2,15 @@ depends_on:
- test
- web
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
when:
event: tag
variables:
- &golang_image 'golang:1.20.2'
- &node_image 'node:18-alpine'
- &when_path
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
pipeline: &legacy
steps:
build-web:
group: prepare
image: *node_image
@ -24,65 +19,47 @@ pipeline: &legacy
- corepack enable
- pnpm install --frozen-lockfile
- pnpm 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
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
@ -96,7 +73,3 @@ pipeline: &legacy
- dist/*.rpm
- dist/checksums.txt
title: ${CI_COMMIT_TAG##v}
when:
event: tag
steps: *legacy

View file

@ -12,7 +12,7 @@ variables:
- &platforms_preview 'linux/arm/v6,linux/arm64/v8,linux/amd64,linux/riscv64,windows/amd64'
- &platforms_alpine 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le'
pipeline: &legacy
steps:
vendor:
image: *golang_image
pull: true
@ -331,5 +331,3 @@ pipeline: &legacy
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
when:
event: tag
steps: *legacy

View file

@ -8,7 +8,7 @@ variables:
- "cli/**"
- "cmd/cli/**"
pipeline: &legacy
steps:
build-cli:
image: *golang_image
commands:
@ -82,5 +82,3 @@ pipeline: &legacy
path: *when_path
- cron: update_docs
event: cron
steps: *legacy

View file

@ -10,7 +10,7 @@ variables:
# schema changes
- "pipeline/schema/**"
pipeline: &legacy
steps:
vendor:
image: *golang_image
group: prepare
@ -146,5 +146,3 @@ services:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
when:
path: *when_path
steps: *legacy

View file

@ -6,7 +6,7 @@ variables:
# web source code
- "web/**"
pipeline: &legacy
steps:
deps:
image: *node_image
directory: web/
@ -66,5 +66,3 @@ pipeline: &legacy
- pnpm test
when:
path: *when_path
steps: *legacy