From cd928a6a22b64daf5a97b20865d06829f9390e10 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 29 Oct 2024 22:11:26 +0000 Subject: [PATCH] build: switch to forgejo actions --- .forgejo/workflows/push-main.yml | 36 ++++++++++++++++ .forgejo/workflows/push-next.yml | 53 +++++++++++++++++++++++ .woodpecker.yml | 72 -------------------------------- 3 files changed, 89 insertions(+), 72 deletions(-) create mode 100644 .forgejo/workflows/push-main.yml create mode 100644 .forgejo/workflows/push-next.yml delete mode 100644 .woodpecker.yml diff --git a/.forgejo/workflows/push-main.yml b/.forgejo/workflows/push-main.yml new file mode 100644 index 0000000..64c832d --- /dev/null +++ b/.forgejo/workflows/push-main.yml @@ -0,0 +1,36 @@ +name: Release Please + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + release-plz: + name: Release-plz + runs-on: docker + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Run release-plz release-pr + uses: https://git.kemitix.net/kemitix/rust@v2.3.0 + with: + args: release-plz release-pr --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + - name: Run release-plz release + uses: https://git.kemitix.net/kemitix/rust@v2.3.0 + with: + args: release-plz release --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + diff --git a/.forgejo/workflows/push-next.yml b/.forgejo/workflows/push-next.yml new file mode 100644 index 0000000..52e3fe7 --- /dev/null +++ b/.forgejo/workflows/push-next.yml @@ -0,0 +1,53 @@ +name: Rust + +on: + push: + branches: ["next"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: docker + + strategy: + matrix: + toolchain: + - name: stable + - name: nightly + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Check TODOs + uses: kemitix/todo-checker@v1.1.0 + + - name: Machete + uses: https://git.kemitix.net/kemitix/rust@v2.3.0 + with: + args: ${{ matrix.toolchain.name }} cargo machete + + - name: Format + uses: https://git.kemitix.net/kemitix/rust@v2.3.0 + with: + args: ${{ matrix.toolchain.name }} cargo fmt --all -- --check + + - name: Clippy + uses: https://git.kemitix.net/kemitix/rust@v2.3.0 + with: + args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset clippy + + - name: Build + uses: https://git.kemitix.net/kemitix/rust@v2.3.0 + with: + args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset build + + - name: Test + uses: https://git.kemitix.net/kemitix/rust@v2.3.0 + with: + args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset test + diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index 3fb30bc..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,72 +0,0 @@ -steps: - update-builder-image: - when: - - event: cron - image: docker.io/woodpeckerci/plugin-docker-buildx:4.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, next] - settings: - # kxio-woodpecker-todo-checker - read:issue - repository_token: "4acf14f93747e044aa2d1397367741b53f3d4f8f" - prefix_regex: "(#|//) (TODO|FIXME): " - debug: false - - lint_and_build: - when: - - event: push - branch: [main, next] - - event: tag - 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 --features "fs,network" -- -D warnings -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used - - cargo build --features "fs,network" - - test: - when: - - event: push - branch: [main, next] - - event: tag - image: git.kemitix.net/kemitix/kxio-builder:latest - environment: - CARGO_TERM_COLOR: always - commands: - - cargo test --features "fs,network" - - publish_to_crates_io: - when: - - event: tag - image: docker.io/rust:1.81 - commands: - - cargo login "$CARGO_REGISTRY_TOKEN" - - cargo publish --registry crates-io --no-verify - secrets: [cargo_registry_token] - - publish_to_forgejo: - when: - - event: tag - # INFO: https://woodpecker-ci.org/plugins/Gitea%20Release - image: docker.io/woodpeckerci/plugin-gitea-release:latest - settings: - base_url: https://git.kemitix.net - api_key: - from_secret: FORGEJO_RELEASE_PLUGIN - target: main - prerelease: false