ci: Create a woodpecker pipelines
Some checks failed
ci/woodpecker/tag/checks Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
ci/woodpecker/push/checks Pipeline failed
ci/woodpecker/push/release Pipeline failed

This commit is contained in:
finga 2024-05-23 17:42:35 +02:00
parent 268ac8eed3
commit 1af426fbf3
2 changed files with 95 additions and 0 deletions

73
.woodpecker/checks.yaml Normal file
View file

@ -0,0 +1,73 @@
---
steps:
target:
when:
- event: push
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
failure: ignore
commands:
- rustup target add wasm32-unknown-unknown
fmt:
when:
- event: push
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
failure: ignore
commands:
- rustup component add rustfmt
- cargo fmt --check --all
check:
when:
- event: push
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
commands:
- cargo check
build:
when:
- event: push
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
commands:
- cargo build
test:
when:
- event: push
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
commands:
- cargo test
clippy:
when:
- event: push
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
failure: ignore
commands:
- rustup component add clippy
- cargo clippy
doc:
when:
- event: push
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
commands:
- cargo doc
audit:
when:
- event: push
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
commands:
- cargo install cargo-audit
- cargo audit

22
.woodpecker/release.yaml Normal file
View file

@ -0,0 +1,22 @@
---
steps:
release:
when:
- event: tag
ref: refs/tags/v*
image: rust
environment: [CARGO_TERM_COLOR=always]
pull: true
secrets: [FORGEJO_USER, FORGEJO_TOKEN]
commands:
- rustup target add wasm32-unknown-unknown
- cargo check
- cargo install trunk
- trunk build --release
- tar cfJ ${CI_REPO_NAME}-${CI_COMMIT_TAG}.tar.xz
-C dist
--transform="s/^\./${CI_REPO_NAME}-${CI_COMMIT_TAG}/" .
- curl --user $FORGEJO_USER:$FORGEJO_TOKEN
--upload-file srug-website-${CI_COMMIT_TAG}.tar.xz
https://git.onders.org/api/packages/${CI_REPO_OWNER}/generic/${CI_REPO_NAME}/${CI_COMMIT_TAG}/