Skip to content

Commit 52ed6e9

Browse files
committed
Add a release script
1 parent b97c277 commit 52ed6e9

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ScipDotnet/ScipDotnet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<Version>0.1.6</Version>
7+
<Version>0.1.7</Version>
88
<PackageLicenseFile>LICENSE</PackageLicenseFile>
99
<PackageReadmeFile>readme.md</PackageReadmeFile>
1010
<PackageType>DotnetTool</PackageType>

release.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -eux
3+
4+
# Assert that current branch is main
5+
git rev-parse --abbrev-ref HEAD | grep -q main
6+
7+
# Assert that there are no uncommitted changes
8+
git diff-index --quiet HEAD --
9+
10+
# Bump version in ScipDotnet.csproj
11+
NEW_VERSION="$1"
12+
sed -i.bak "s/<Version>.*<\/Version>/<Version>$NEW_VERSION<\/Version>/" ScipDotnet/ScipDotnet.csproj
13+
rm ScipDotnet/ScipDotnet.csproj.bak
14+
15+
# Commit and tag new version
16+
VERSION_TAG="v$NEW_VERSION"
17+
git add .
18+
git commit -m "Bump version to $VERSION_TAG" --allow-empty
19+
git push origin main
20+
git tag -af "$VERSION_TAG" -m "Version $NEW_VERSION"
21+
git push -f origin "$VERSION_TAG"

0 commit comments

Comments
 (0)