Take version from stepper

This commit is contained in:
folex 2020-12-31 11:05:55 +03:00
parent 8ad7c0c765
commit b58eb7fa95
2 changed files with 4 additions and 2 deletions

View File

@ -61,13 +61,14 @@ jobs:
yarn global add semver
PATH="$(yarn global bin):$PATH"
STEPPER_CARGO_TOML="stepper/Cargo.toml"
CARGO_TOML="crates/air-interpreter-wasm/Cargo.toml"
# get package name from Cargo.toml
RS_PKG_NAME="$(toml get "$CARGO_TOML" package.name | tr -d \")"
JS_PKG_NAME="@fluencelabs/aquamarine-stepper"
# get version from Cargo.toml
LOCAL_RUST_VERSION="$(toml get "$CARGO_TOML" package.version | tr -d \")"
LOCAL_RUST_VERSION="$(toml get "$STEPPER_CARGO_TOML" package.version | tr -d \")"
# get & increment version from NPM
JS_VERSION="$(yarn info --silent "$JS_PKG_NAME" version || true)"

View File

@ -70,6 +70,7 @@ jobs:
yarn global add semver
PATH="$(yarn global bin):$PATH"
STEPPER_CARGO_TOML="stepper/Cargo.toml"
CARGO_TOML="crates/air-interpreter-wasm/Cargo.toml"
# sanitize branch name so it can be used as a semver suffix (replace [^0-9a-zA-Z-] with hyphen)
@ -101,7 +102,7 @@ jobs:
### LOCAL
### (NOTE: the following code assumes that local versions do not contain prerelease suffix; existing suffix will be ignored)
# take local Rust version
LOCAL_RUST_VERSION="$(toml get "$CARGO_TOML" package.version | tr -d \")"
LOCAL_RUST_VERSION="$(toml get "$STEPPER_CARGO_TOML" package.version | tr -d \")"
LOCAL_RUST_PRERELEASE_VERSION="$(semver --increment prerelease --preid "$SANITIZED_BRANCH" "${LOCAL_RUST_VERSION}-0")" # added '-0' here to avoid semver erroneously increment patch octet. Any suffix works, '-0' is chosen deliberately.
### SAVE FINAL VERSION TO ENV