Skip to content

Commit

Permalink
CI: Added build and draft release job
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyoxis committed Mar 5, 2024
1 parent cebef9c commit e324026
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/rust-cargo-build.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e324026

Please sign in to comment.