From 323ecfc83f84997f9607e694cddcdcee61bcc5ba Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 8 Apr 2024 17:55:41 +0100 Subject: [PATCH] build(woodpecker): merge jobs and publish to crates on tag --- .woodpecker.yml | 86 ++++++++++++++++++++++++++++++++++++++ .woodpecker/build.yml | 45 -------------------- .woodpecker/release.yml | 14 ------- .woodpecker/todo-check.yml | 13 ------ 4 files changed, 86 insertions(+), 72 deletions(-) create mode 100644 .woodpecker.yml delete mode 100644 .woodpecker/build.yml delete mode 100644 .woodpecker/release.yml delete mode 100644 .woodpecker/todo-check.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..179c03d --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,86 @@ +steps: + + update-builder-image: + when: + - event: cron + image: docker.io/woodpeckerci/plugin-docker-buildx:3.2 + settings: + username: kemitix + repo: git.kemitix.net/kemitix/kxio-builder + auto_tag: true + dockerfile: Dockerfile.builder + dry-run: false # push to remote repo + registry: git.kemitix.net + password: + from_secret: woodpecker-docker-push + + todo_check: + # INFO: https://woodpecker-ci.org/plugins/TODO-Checker + image: codeberg.org/epsilon_02/todo-checker:1.1 + when: + - event: push + branch: main + settings: + # kxio-woodpecker-todo-checker - read:issue + repository_token: '4acf14f93747e044aa2d1397367741b53f3d4f8f' + prefix_regex: "(#|//) (TODO|FIXME): " + debug: false + + build: + when: + - event: push + branch: main + - event: tag + ref: refs/tags/v* + image: git.kemitix.net/kemitix/kxio-builder:latest + environment: + CARGO_TERM_COLOR: always + + lint: + when: + - event: push + branch: main + - event: tag + ref: refs/tags/v* + image: git.kemitix.net/kemitix/kxio-builder:latest + environment: + CARGO_TERM_COLOR: always + commands: + - ls -l /usr/local/cargo/bin/ + - cargo fmt --all -- --check + - cargo clippy -- -D warnings -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used + + test: + when: + - event: push + branch: main + - event: tag + ref: refs/tags/v* + image: git.kemitix.net/kemitix/kxio-builder:latest + environment: + CARGO_TERM_COLOR: always + commands: + - cargo test + + publish_to_forgejo: + when: + - event: tag + ref: refs/tags/v* + # INFO: https://woodpecker-ci.org/plugins/Gitea%20Release + image: docker.io/woodpeckerci/plugin-gitea-release:0.3 + settings: + base_url: https://git.kemitix.net + api_key: + from_secret: FORGEJO_RELEASE_PLUGIN + target: main + prerelease: true + + publish_to_crates_io: + when: + - event: tag + ref: refs/tags/v* + image: docker.io/rust:1.76 + commands: + - cargo login "$CARGO_REGISTRY_TOKEN" + - cargo publish --registry crates-io --no-verify + secrets: [cargo_registry_token] diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml deleted file mode 100644 index b54cfc5..0000000 --- a/.woodpecker/build.yml +++ /dev/null @@ -1,45 +0,0 @@ -steps: - - update-builder-image: - when: - - event: cron - image: docker.io/woodpeckerci/plugin-docker-buildx:3.2 - settings: - username: kemitix - repo: git.kemitix.net/kemitix/kxio-builder - auto_tag: true - dockerfile: Dockerfile.builder - dry-run: false # push to remote repo - registry: git.kemitix.net - password: - from_secret: woodpecker-docker-push - - build: - when: - - event: push - branch: main - image: git.kemitix.net/kemitix/kxio-builder:latest - environment: - CARGO_TERM_COLOR: always - - lint: - when: - - event: push - branch: main - image: git.kemitix.net/kemitix/kxio-builder:latest - environment: - CARGO_TERM_COLOR: always - commands: - - ls -l /usr/local/cargo/bin/ - - cargo fmt --all -- --check - - cargo clippy -- -D warnings -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used - - test: - when: - - event: push - branch: main - image: git.kemitix.net/kemitix/kxio-builder:latest - environment: - CARGO_TERM_COLOR: always - commands: - - cargo test diff --git a/.woodpecker/release.yml b/.woodpecker/release.yml deleted file mode 100644 index f8b8539..0000000 --- a/.woodpecker/release.yml +++ /dev/null @@ -1,14 +0,0 @@ -# INFO: https://woodpecker-ci.org/plugins/Gitea%20Release -steps: - - publish: - when: - - event: tag - ref: refs/tags/v* - image: docker.io/woodpeckerci/plugin-gitea-release:0.3 - settings: - base_url: https://git.kemitix.net - api_key: - from_secret: FORGEJO_RELEASE_PLUGIN - target: main - prerelease: true diff --git a/.woodpecker/todo-check.yml b/.woodpecker/todo-check.yml deleted file mode 100644 index a8a8f28..0000000 --- a/.woodpecker/todo-check.yml +++ /dev/null @@ -1,13 +0,0 @@ -# INFO: https://woodpecker-ci.org/plugins/TODO-Checker -steps: - - todo_check: - image: codeberg.org/epsilon_02/todo-checker:1.1 - when: - - event: push - branch: main - settings: - # kxio-woodpecker-todo-checker - read:issue - repository_token: '4acf14f93747e044aa2d1397367741b53f3d4f8f' - prefix_regex: "(#|//) (TODO|FIXME): " - debug: false