Skip to content

Commit

Permalink
[PLA-2073] Check cargo version (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocustodio authored Nov 12, 2024
1 parent ca60025 commit 23e015d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/check-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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" ]; then
if [ "$version" != "$compare_version" ]; then
echo "The version in Cargo.toml ($version) is lower than $compare_version"
exit 1
else
echo "The version in Cargo.toml ($version) is equal to $compare_version"
exit 1
fi
else
echo "The version in Cargo.toml ($version) is higher than $compare_version"
fi
4 changes: 4 additions & 0 deletions .github/workflows/security-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
jobs:
audit:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions-rs/audit-check@v1
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wallet-daemon"
version = "2.0.0"
version = "2.0.2"
edition = "2021"

[dependencies]
Expand Down Expand Up @@ -30,4 +30,4 @@ sp-core = { version = "34.0.0", default-features = false, features = [
] }
bip39 = { version = "2.0.0", features = ["rand"] }
autoincrement = "1.0.1"
lru = "0.12.5"
lru = "0.12.5"

0 comments on commit 23e015d

Please sign in to comment.