BlueGit

timfa posprint

Files

posprint / scripts / ci / set-version.sh

set-version.sh

set-version.sh 496 B Download Raw
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.
4set -euo pipefail
5cd "$(dirname "$0")/../.."
6v="$(cat artifacts/version.txt)"
7sed -i "0,/^version = .*/s//version = \"$v\"/" Cargo.toml
8awk -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
9echo "Version: $v"