From d2762e830e9f7cdc1e5d81eeaad1ca42c6c7f8eb Mon Sep 17 00:00:00 2001 From: TheAwiteb Date: Mon, 29 Jan 2024 23:24:04 +0300 Subject: [PATCH] Add github workflows --- .github/FUNDING.yml | 1 + .github/workflows/cd.yml | 35 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..07292fe --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: "TheAwiteb" \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..21322e1 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,35 @@ +name: CD + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ + +jobs: + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@stable + - name: Build Changelog 🏗 + id: changelog + uses: mikepenz/release-changelog-builder-action@v4.0.0 + with: + configuration: "./.github/config/changelog-builder-action.json" + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + + - name: Create Release 🖋 + uses: softprops/action-gh-release@v1 + with: + prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'pre') }} + body: ${{steps.changelog.outputs.changelog}} + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + + - name: Publish to crates.io 🚀 + uses: katyo/publish-crates@v2 + with: + token: ${{ secrets.PAT }} + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fe291c2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: Rust build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo build --workspace --all-features --all-targets + rustfmt: + name: Rust format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo fmt -- --check + check: + name: Rust check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --workspace --all-features --all-targets + clippy: + name: Rust clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo clippy --workspace --all-features -- -D warnings + test: + name: Rust test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo test --workspace --all-features