From e324026c5fb366fa6acd8c719e03a9d4d00575e5 Mon Sep 17 00:00:00 2001 From: Nyoxis Date: Tue, 5 Mar 2024 04:57:32 +0200 Subject: [PATCH] CI: Added build and draft release job --- .github/workflows/rust-cargo-build.yml | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/rust-cargo-build.yml diff --git a/.github/workflows/rust-cargo-build.yml b/.github/workflows/rust-cargo-build.yml new file mode 100644 index 0000000..c2bb3d5 --- /dev/null +++ b/.github/workflows/rust-cargo-build.yml @@ -0,0 +1,49 @@ +name: Rust cargo build + +on: + push: + branches: + - main + - stable + +jobs: + check: + name: Cargo build + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: Checkout sources + uses: actions/checkout@v4.1.1 + with: + fetch-depth: 50 + submodules: 'recursive' + + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1.0.7 + with: + profile: minimal + toolchain: stable + override: true + + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.3 + + - name: cargo build + run: cargo build --release + + - name: Get package version + run: > + echo "VERSION=$( + cargo metadata --no-deps | + jq -r '.packages[] | select(.name == "kalatori") | .version' + )" >> $GITHUB_ENV + + - name: Draft release binary + run: gh release create -d $VERSION ./target/release/kalatori --generate-notes \ No newline at end of file