| 1 | #!/usr/bin/env bash |
| 2 | # Write the release version (artifacts/version.txt) into Cargo.toml/Cargo.lock |
| 3 | # before building, so the .deb/.pkg/.exe carry the same version as the tag. |
| 4 | set -euo pipefail |
| 5 | cd "$(dirname "$0")/../.." |
| 6 | v="$(cat artifacts/version.txt)" |
| 7 | sed -i "0,/^version = .*/s//version = \"$v\"/" Cargo.toml |
| 8 | awk -v v="$v" 'p&&/^version = /{print "version = \"" v "\"";p=0;next} /^name = "posprint"$/{p=1} {print}' Cargo.lock > Cargo.lock.new && mv Cargo.lock.new Cargo.lock |
| 9 | echo "Version: $v" |