TrustTunnel/scripts/set_version.sh
Ilia Zhirov 7948fd9e0e
Some checks failed
Check CHANGELOG and auto-tag / Check CHANGELOG and auto-tag (push) Has been cancelled
Lint Markdown / lint (push) Has been cancelled
Lint Rust / lint (push) Has been cancelled
Mirror to public repository / Mirror to public repository (push) Has been cancelled
Run tests (public) / Linux (push) Has been cancelled
Run tests (public) / macOS (push) Has been cancelled
Run tests / Linux build (push) Has been cancelled
Run tests / Mac build (push) Has been cancelled
Setup workflows for repository / Disable workflows with private uses (push) Has been cancelled
Setup workflows for repository / Disable public-only workflows in private repo (push) Has been cancelled
TRUST-544 trusttunnel endpoint gh actions (#1)
* Update Rust toolchain to 1.95

* Convert CHANGELOG to Keep a Changelog format

* Add set_version.sh for release PR automation

* Add autotag workflow via native-libs-common

* Add create-release-pr workflow via native-libs-common

* Add mirror workflow to sync with public repository

* Use proper private repo

* Add private run-tests workflow for self-hosted runners

* Add public run-tests workflow for GitHub-hosted runners

* Add public lint-md workflow using npm markdownlint-cli

* Add build-and-deploy-release workflow with Vault GPG signing

* Add deploy-dockerhub workflow with Vault credentials

* Add setup-workflows to disable inappropriate workflows per repo

* Remove obsolete workflows and increment_version.sh

* Update Rust version in AGENTS.md

* Fix some issues and inconsistencies

* Add missing macOS build and couple of fixes

* Add separate lint-rust workflow

* Update action versions in bench workflow

* Remove ephemeral-limit-disk-gb-70

* Keep security-audit on public repository

* Fix lint and format errors after upgrade to Rust 1.95

* Replace non-existant tags with revision hashes

* Add dates to CHANGELOG
2026-05-29 19:14:52 +05:00

48 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
# Set version in all project files.
#
# Usage: ./scripts/set_version.sh <version>
# Example: ./scripts/set_version.sh 1.2.0
#
# This script must be run from the project root directory.
# It updates version in:
# - endpoint/Cargo.toml
# - Cargo.lock
# - scripts/install.sh
set -e
VERSION=$1
if [ -z "$VERSION" ]; then
echo "Usage: $0 <version>"
echo "Example: $0 1.2.0"
exit 1
fi
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Invalid version format. Expected X.Y.Z (e.g., 1.2.0)"
exit 1
fi
echo "Setting version to $VERSION"
# endpoint/Cargo.toml
cargo_toml="endpoint/Cargo.toml"
OLD_VERSION=$(grep '^version = ' "$cargo_toml" | head -1 | sed -e 's/version = "\(.*\)"/\1/')
sed -i -e "s/^version = \"${OLD_VERSION}\"/version = \"${VERSION}\"/" "$cargo_toml"
echo "Updated ${cargo_toml}"
# Cargo.lock — regenerate to pick up the new version
cargo generate-lockfile
echo "Updated Cargo.lock"
# scripts/install.sh
install_sh="scripts/install.sh"
if [ -f "$install_sh" ]; then
sed -i -e "s/^version='[0-9\.]*'$/version='${VERSION}'/" "$install_sh"
echo "Updated ${install_sh}"
fi
echo "Version set to $VERSION in all project files."