diff options
| author | Linus Färnstrand <faern@faern.net> | 2022-10-03 16:45:11 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2022-10-10 09:42:42 +0200 |
| commit | 470034112d564915250b05130d6671f02cebe109 (patch) | |
| tree | 6f889994c6ca1bd497baee491ad3af34e0d763e8 | |
| parent | 321d18f39e7c1e2cf41feaa856fe05127552f82d (diff) | |
| download | mullvadvpn-470034112d564915250b05130d6671f02cebe109.tar.xz mullvadvpn-470034112d564915250b05130d6671f02cebe109.zip | |
Use mullvad-version in build.sh
| -rwxr-xr-x | build.sh | 9 | ||||
| -rw-r--r-- | mullvad-version/src/main.rs | 3 |
2 files changed, 5 insertions, 7 deletions
@@ -17,7 +17,7 @@ source scripts/utils/log RUSTC_VERSION=$(rustc --version) CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-"target"} -PRODUCT_VERSION=$(cd gui/; node -p "require('./package.json').version" | sed -Ee 's/\.0//g') +PRODUCT_VERSION=$(cargo run -q --bin mullvad-version) # If compiler optimization and artifact compression should be turned on or not OPTIMIZE="false" @@ -51,10 +51,7 @@ done # Everything that is not a release build is called a "dev build" and has "-dev-{commit hash}" # appended to the version name. IS_RELEASE="false" -product_version_commit_hash=$(git rev-parse "$PRODUCT_VERSION^{commit}" || echo "") -current_head_commit_hash=$(git rev-parse "HEAD^{commit}") -if [[ "$SIGN" == "true" && "$OPTIMIZE" == "true" && \ - $product_version_commit_hash == "$current_head_commit_hash" ]]; then +if [[ "$SIGN" == "true" && "$OPTIMIZE" == "true" && "$PRODUCT_VERSION" != *"-dev-"* ]]; then IS_RELEASE="true" fi @@ -135,8 +132,6 @@ if [[ "$IS_RELEASE" == "true" ]]; then # Will not allow an outdated lockfile in releases CARGO_ARGS+=(--locked) else - PRODUCT_VERSION="$PRODUCT_VERSION-dev-${current_head_commit_hash:0:6}" - # Allow dev builds to override which API server to use at runtime. CARGO_ARGS+=(--features api-override) diff --git a/mullvad-version/src/main.rs b/mullvad-version/src/main.rs new file mode 100644 index 0000000000..3e04334201 --- /dev/null +++ b/mullvad-version/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("{}", mullvad_version::VERSION); +} |
