From 9f5c86b7831cc545df0b7380340f3400a6c3d8de Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Fri, 3 Apr 2026 04:30:13 +0200 Subject: [PATCH] chore(actions): Setup workflows --- .gitea/workflows/audit.yaml | 23 +++++++++++++++ .gitea/workflows/ci.yaml | 32 +++++++++++++++++++++ .gitea/workflows/release.yaml | 53 +++++++++++++++++++++++++++++++++++ .release-plz.toml | 18 ++++++++++++ cliff.toml | 22 --------------- 5 files changed, 126 insertions(+), 22 deletions(-) create mode 100644 .gitea/workflows/audit.yaml create mode 100644 .gitea/workflows/ci.yaml create mode 100644 .gitea/workflows/release.yaml create mode 100644 .release-plz.toml delete mode 100644 cliff.toml diff --git a/.gitea/workflows/audit.yaml b/.gitea/workflows/audit.yaml new file mode 100644 index 0000000..1fb7bea --- /dev/null +++ b/.gitea/workflows/audit.yaml @@ -0,0 +1,23 @@ +name: Audit + +on: + push: + paths: + - "**/Cargo.toml" + - "**/Cargo.lock" + schedule: + - cron: "0 0 * * *" + +jobs: + audit: + name: cargo audit + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + - uses: rustsec/audit-check@v2.0.0 + with: + token: ${{ secrets.GITEA_TOKEN }} diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..c10a4a2 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,32 @@ +name: CI +on: + push: + branches: + - "main" + tags: + - "*" + pull_request: + +jobs: + prek: + name: prek + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v2 + - uses: j178/prek-action@v2 + + cargo-shear: + name: cargo shear + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@v2 + with: + tool: cargo-shear + - run: cargo shear --deny-warnings diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..3d274bf --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,53 @@ +name: Release-plz + +on: + push: + branches: + - main + +jobs: + release-plz: + name: Release-plz Release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - &checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@v2 + with: + tool: release-plz + - &git-setup + name: Configure git + run: | + git config user.name "Release-plz" + git config user.email "release-plz@noreply.huizinga.dev" + git config url.https://${{ gitea.actor }}:${{ secrets.GITEA_TOKEN }}@git.huizinga.dev/.insteadOf https://git.huizinga.dev/ + - env: + CARGO_REGISTRIES_INFRA_TOKEN: "Bearer ${{ secrets.REGISTRY_TOKEN }}" + run: release-plz release --git-token "${{ secrets.RELEASE_PLZ_TOKEN }}" --forge gitea --dry-run + + release-plz-pr: + name: Release-plz PR + runs-on: ubuntu-latest + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + permissions: + contents: write + pull-requests: write + steps: + - *checkout + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@v2 + with: + tool: release-plz + - *git-setup + - run: release-plz release-pr --git-token "${{ secrets.RELEASE_PLZ_TOKEN }}" --forge gitea diff --git a/.release-plz.toml b/.release-plz.toml new file mode 100644 index 0000000..e157eb4 --- /dev/null +++ b/.release-plz.toml @@ -0,0 +1,18 @@ +[workspace] +pr_name = "chore(release): Release v{{ version }}" + +[[package]] +name = "xtask" +release = false + +[changelog] +commit_parsers = [ + { message = "^feat", group = "Features" }, + { message = "^revert", group = "Revert" }, + { message = "^fix", group = "Bug Fixes" }, + { message = "^refactor", group = "Refactor" }, + { message = "^test", group = "Testing" }, + { message = "^chore\\(release\\)", skip = true }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore|^ci", group = "Miscellaneous Tasks" }, +] diff --git a/cliff.toml b/cliff.toml deleted file mode 100644 index 2bf1358..0000000 --- a/cliff.toml +++ /dev/null @@ -1,22 +0,0 @@ -[changelog] -header = """ -# Changelog -""" - -[bump] -# TODO: Remove this option once we release v1.0.0 -breaking_always_bump_major = false - -[git] -fail_on_unmatched_commit = true -require_conventional = true -commit_parsers = [ - { message = "^feat", group = "Features" }, - { message = "^fix", group = "Bug Fixes" }, - { message = "^refactor", group = "Refactor" }, - { message = "^test", group = "Testing" }, - { message = "^chore\\(release\\): Prepare for", skip = true }, - { message = "^chore\\(deps.*\\)", skip = true }, - { message = "^chore|^ci", group = "Miscellaneous Tasks" }, - { message = "^revert", group = "Revert" }, -]