BlueGit

timfa posprint

Files

posprint / scripts / ci / experimental-version.sh

experimental-version.sh

experimental-version.sh 525 B Download Raw
1#!/usr/bin/env bash
2# Version for experimental/tspl2 builds: <Cargo.toml version>-tspl2.<pipeline id>.
3# Never a bare X.Y.Z, so it can never collide with a stable release or AUR.
4set -euo pipefail
5cd "$(dirname "$0")/../.."
6base="$(grep -m1 '^version = ' Cargo.toml | sed -E 's/.*"([^"]+)"/\1/')"
7base="${base%%-*}"
8mkdir -p artifacts
9v="${base}-tspl2.${CI_PIPELINE_ID:-0}"
10[[ "$v" =~ ^[0-9]+\.[0-9]+\.[0-9]+-tspl2\.[0-9]+$ ]] || { echo "Invalid experimental version: $v" >&2; exit 1; }
11echo "$v" | tee artifacts/version.txt