Skip to content

Commit

Permalink
Merge branch 'ah' into readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fluiderson committed Mar 7, 2024
2 parents f4fddfa + 690e5cf commit e9b0be7
Show file tree
Hide file tree
Showing 18 changed files with 2,637 additions and 326 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/rust-cargo-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Rust cargo build and draft release

on:
push:
branches:
- main

jobs:
cargo-build:
name: Cargo build
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 50
submodules: 'recursive'

- name: Install Rust stable toolchain
uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: stable
override: true

- name: Rust Cache
uses: Swatinem/[email protected]

- name: cargo build
run: cargo build --release

- name: Get package version
run: >
echo "VERSION=$(
cargo metadata --format-version=1 --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
71 changes: 71 additions & 0 deletions .github/workflows/rust-check-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Rust check version

on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- main

jobs:
version:
name: Check version
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Install Rust stable toolchain
uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: stable
override: true

- name: Checkout base
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 50
submodules: 'recursive'

- name: Checkout before push
uses: actions/[email protected]
if: github.event_name != 'pull_request'
with:
ref: ${{ github.event.before }}
fetch-depth: 50
submodules: 'recursive'

- name: Get package version before or base
run: >
echo "BEFORE_VERSION=$(
cargo metadata --format-version=1 --no-deps |
jq -r '.packages[] | select(.name == "kalatori") | .version'
)" >> $GITHUB_ENV
- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 50
submodules: 'recursive'

- name: Get package version
run: >
echo "VERSION=$(
cargo metadata --format-version=1 --no-deps |
jq -r '.packages[] | select(.name == "kalatori") | .version'
)" >> $GITHUB_ENV
- name: Check which version is greater
run: ./is_version_greater.sh $VERSION $BEFORE_VERSION


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
target
database.redb
database-ah-usdc.redb
database-ah-usdt.redb
Loading

0 comments on commit e9b0be7

Please sign in to comment.