Skip to content

Update check-version.yml #7

Update check-version.yml

Update check-version.yml #7

Workflow file for this run

name: Check Version
on:
push:
pull_request:
concurrency:
group: check-version-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: check
run: |
# Fetch the version from Cargo.toml
version=$(grep -m 1 '^version' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
# Fetch the JSON data using curl
json_data=$(curl -s https://api.github.com/repos/enjin/wallet-daemon/releases/latest)
# Extract the tag_name and remove the leading 'v'
compare_version=$(echo "$json_data" | jq -r '.tag_name' | sed 's/^v//')
# Compare versions
if [ "$(printf '%s\n' "$version" "$compare_version" | sort -V | head -n 1)" = "$version" ] && [ "$version" != "$compare_version" ]; then
exit 1
fi