-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·56 lines (44 loc) · 1.31 KB
/
release.sh
File metadata and controls
executable file
·56 lines (44 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
PROJECT="$(basename "$(pwd)")"
CHANGELOG="Changelog.txt"
DEV_BRANCH="dev"
tag=$1
ver="$(grep -Eo '(([0-9]+\.){0,3}[0-9]+)' <<< "$1")"
# Short version with v: the base tag for the UpdateChecker manifest
mver="v${ver}"
while [ "$(echo "$ver" | tr -dc '.' | awk '{ print length; }')" -lt "3" ]
do
ver="${ver}.0"
done
sed -i 's/AssemblyVersion(.*)/AssemblyVersion("'$ver'")/' $PROJECT/Properties/AssemblyInfo.cs
sed -i 's/AssemblyFileVersion(.*)/AssemblyFileVersion("'$ver'")/' $PROJECT/Properties/AssemblyInfo.cs
sed -i 's/"version": ".*",/"version": "'$mver'",/' $PROJECT/manifest.json
mv "$CHANGELOG"{,.old}
echo "${tag}" > "$CHANGELOG"
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:' %s' >> "$CHANGELOG"
echo -e "\n" >> "$CHANGELOG"
cat "$CHANGELOG".old >> "$CHANGELOG"
$EDITOR "$CHANGELOG"
_status=$?
if [[ $_status != 0 ]]; then
echo "Aborting..."
rm "$CHANGELOG"
mv "$CHANGELOG"{.old,}
exit
fi
rm "$CHANGELOG".old
git add $PROJECT/Properties/AssemblyInfo.cs $PROJECT/manifest.json "$CHANGELOG"
git commit -m "${tag}"
git tag "${tag}"
msbuild
pushd ChroMapper-PropEdit/bin/Dev
zip "ChroMapper-13-PropEdit ${tag}.zip" Plugins/ChroMapper-PropEdit.dll
popd
echo "Check..."
read || exit
git push
git checkout main
git merge --ff-only $DEV_BRANCH
git push
git push --tags
git checkout $DEV_BRANCH