mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-23 02:11:01 +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
|
- test
|
||||||
- web
|
- web
|
||||||
|
|
||||||
|
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- &golang_image 'golang:1.20.2'
|
- &golang_image 'golang:1.20.2'
|
||||||
- &node_image 'node:18-alpine'
|
- &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:
|
build-web:
|
||||||
group: prepare
|
group: prepare
|
||||||
image: *node_image
|
image: *node_image
|
||||||
|
@ -24,65 +19,47 @@ pipeline: &legacy
|
||||||
- corepack enable
|
- corepack enable
|
||||||
- pnpm install --frozen-lockfile
|
- pnpm install --frozen-lockfile
|
||||||
- pnpm build
|
- pnpm build
|
||||||
when:
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
vendor:
|
vendor:
|
||||||
group: prepare
|
group: prepare
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
- go mod vendor
|
- go mod vendor
|
||||||
when:
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
build-server:
|
build-server:
|
||||||
group: build
|
group: build
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
- make release-server
|
- make release-server
|
||||||
when:
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
build-agent:
|
build-agent:
|
||||||
group: build
|
group: build
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
- make release-agent
|
- make release-agent
|
||||||
when:
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
build-cli:
|
build-cli:
|
||||||
group: build
|
group: build
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
- make release-cli
|
- make release-cli
|
||||||
when:
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
build-deb-rpm:
|
build-deb-rpm:
|
||||||
group: bundle
|
group: bundle
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
- make bundle
|
- make bundle
|
||||||
when:
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
checksums:
|
checksums:
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
- make release-checksums
|
- make release-checksums
|
||||||
when:
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
|
|
||||||
release-dryrun:
|
release-dryrun:
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
- ls -la dist/*.*
|
- ls -la dist/*.*
|
||||||
- cat dist/checksums.txt
|
- cat dist/checksums.txt
|
||||||
when:
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
image: plugins/github-release
|
image: plugins/github-release
|
||||||
|
@ -96,7 +73,3 @@ pipeline: &legacy
|
||||||
- dist/*.rpm
|
- dist/*.rpm
|
||||||
- dist/checksums.txt
|
- dist/checksums.txt
|
||||||
title: ${CI_COMMIT_TAG##v}
|
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_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'
|
- &platforms_alpine 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le'
|
||||||
|
|
||||||
pipeline: &legacy
|
steps:
|
||||||
vendor:
|
vendor:
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
pull: true
|
pull: true
|
||||||
|
@ -331,5 +331,3 @@ pipeline: &legacy
|
||||||
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
|
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
|
||||||
steps: *legacy
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ variables:
|
||||||
- "cli/**"
|
- "cli/**"
|
||||||
- "cmd/cli/**"
|
- "cmd/cli/**"
|
||||||
|
|
||||||
pipeline: &legacy
|
steps:
|
||||||
build-cli:
|
build-cli:
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
commands:
|
commands:
|
||||||
|
@ -82,5 +82,3 @@ pipeline: &legacy
|
||||||
path: *when_path
|
path: *when_path
|
||||||
- cron: update_docs
|
- cron: update_docs
|
||||||
event: cron
|
event: cron
|
||||||
|
|
||||||
steps: *legacy
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ variables:
|
||||||
# schema changes
|
# schema changes
|
||||||
- "pipeline/schema/**"
|
- "pipeline/schema/**"
|
||||||
|
|
||||||
pipeline: &legacy
|
steps:
|
||||||
vendor:
|
vendor:
|
||||||
image: *golang_image
|
image: *golang_image
|
||||||
group: prepare
|
group: prepare
|
||||||
|
@ -146,5 +146,3 @@ services:
|
||||||
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
|
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
|
||||||
when:
|
when:
|
||||||
path: *when_path
|
path: *when_path
|
||||||
|
|
||||||
steps: *legacy
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ variables:
|
||||||
# web source code
|
# web source code
|
||||||
- "web/**"
|
- "web/**"
|
||||||
|
|
||||||
pipeline: &legacy
|
steps:
|
||||||
deps:
|
deps:
|
||||||
image: *node_image
|
image: *node_image
|
||||||
directory: web/
|
directory: web/
|
||||||
|
@ -66,5 +66,3 @@ pipeline: &legacy
|
||||||
- pnpm test
|
- pnpm test
|
||||||
when:
|
when:
|
||||||
path: *when_path
|
path: *when_path
|
||||||
|
|
||||||
steps: *legacy
|
|
||||||
|
|
Loading…
Reference in a new issue