From 1d4ce867e5273498207399874c1a8948be68a682 Mon Sep 17 00:00:00 2001 From: VC Date: Wed, 3 Dec 2025 15:12:52 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7:=20add=20gitea=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/check.yml | 20 ++++++++++++++++++++ .gitea/workflows/release.yml | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .gitea/workflows/check.yml create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/check.yml b/.gitea/workflows/check.yml new file mode 100644 index 0000000..64f1613 --- /dev/null +++ b/.gitea/workflows/check.yml @@ -0,0 +1,20 @@ +--- + +name: rust-check + +on: # yamllint disable-line rule:truthy + - push + +jobs: + rust-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + with: + components: "clippy,rustfmt" + - run: cargo fmt -- --check + - run: cargo check + - run: cargo clippy -- -D warnings + - run: cargo test + - run: cargo build diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..b834155 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,23 @@ +--- + +name: rust-release + +on: # yamllint disable-line rule:truthy + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - name: Get package name + run: echo "CARGO_PKG_NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')" >> $GITEA_ENV + - run: cargo build --release + - uses: https://gitea.com/actions/gitea-release-action@v1 + with: + files: |- + target/release/${{ env.CARGO_PKG_NAME }} + api_key: '${{ secrets.RELEASE_TOKEN }}'