feat: Add README #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |