forked from TelemetryDeck/SwiftSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtag-release.sh
More file actions
executable file
·23 lines (17 loc) · 813 Bytes
/
tag-release.sh
File metadata and controls
executable file
·23 lines (17 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -euo pipefail
# Invoke this script via: ./tag-release.sh MAJOR.MINOR.PATCH
# Validate that there are no changes in Git prior making a release commit
if [[ -n "$(git status --porcelain)" ]]; then
echo "ERROR! There are uncommitted changes, can't tag a release without a clean state.";
exit 1
fi
version=$1
# Replace version String in TelemetryClient.swift with specified version
sed -i '' "s/\"SwiftClient .*\"/\"SwiftClient $version\"/g" Sources/TelemetryClient/TelemetryClient.swift
# Make a commit & tag it
git add Sources/TelemetryClient/TelemetryClient.swift
git commit -m "Bump Version to $version"
git tag $version $(git rev-parse HEAD)
echo "Successfully created a bump commit & tagged it with '$version'."
echo "After checking everything, push the commit including the new tag!"