From 1af426fbf383d648b0f02bc394451311874b7f24 Mon Sep 17 00:00:00 2001 From: finga Date: Thu, 23 May 2024 17:42:35 +0200 Subject: [PATCH] ci: Create a woodpecker pipelines --- .woodpecker/checks.yaml | 73 ++++++++++++++++++++++++++++++++++++++++ .woodpecker/release.yaml | 22 ++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 .woodpecker/checks.yaml create mode 100644 .woodpecker/release.yaml diff --git a/.woodpecker/checks.yaml b/.woodpecker/checks.yaml new file mode 100644 index 0000000..120f9d3 --- /dev/null +++ b/.woodpecker/checks.yaml @@ -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 diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml new file mode 100644 index 0000000..c5e7a3d --- /dev/null +++ b/.woodpecker/release.yaml @@ -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}/