Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
self versioning was added
Browse files Browse the repository at this point in the history
fenriz07 committed Jul 2, 2024
1 parent 94b6d02 commit cf52111
Showing 2 changed files with 21 additions and 2 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -53,7 +53,27 @@ jobs:
toolchain: stable
- name: Compile
run: |
VERSION=$(cat .version)
ELYSD=./elysd
json=$($ELYSD q --output json --node "${{vars.NODE}}" wasm contract-state smart "${{vars.FS_CONTRACT_ADDRESS}}" '{ "version": {} }')
echo "Response json: $json"
VERSION=$(echo $json | jq -r ".data.version")
echo "Current version: $VERSION"
# Extract the major, minor, and patch versions
version_parts=(${VERSION//./ })
major=${version_parts[0]}
minor=${version_parts[1]}
patch=${version_parts[2]}
# Increment the minor version
minor=$((minor + 1))
# Update the version string
VERSION="$major.$minor.$patch"
# Print the updated version number
echo "New version number: $new_version"
sed -i "s/^version = .*/version = \"$VERSION\"/" contracts/account-history-contract/Cargo.toml
sed -i "s/^version = .*/version = \"$VERSION\"/" contracts/trade-shield-contract/Cargo.toml
sed -i "s/^version = .*/version = \"$VERSION\"/" contracts/financial-snapshot-contract/Cargo.toml
1 change: 0 additions & 1 deletion .version

This file was deleted.

0 comments on commit cf52111

Please sign in to comment.