mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
Optimize pipeline and switch to "steps" (#1901)
This commit is contained in:
parent
44b54db475
commit
3f534cfff6
5 changed files with 9 additions and 44 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue