poulpy/poulpy-backend/src/cpu_spqlios/spqlios-arithmetic/scripts/auto-release.sh
poulpy-backend/src/cpu_spqlios/spqlios-arithmetic/scripts/auto-release.shRaw
1#!/bin/sh
2
3# this script generates one tag if there is a version change in manifest.yaml
4cd `dirname $0`/..
5if [ "v$1" = "v-y" ]; then
6 echo "production mode!";
7fi
8changes=`git diff HEAD~1..HEAD -- manifest.yaml | grep 'version:'`
9oldversion=$(echo "$changes" | grep '^-version:' | cut '-d ' -f2)
10version=$(echo "$changes" | grep '^+version:' | cut '-d ' -f2)
11echo "Versions: $oldversion --> $version"
12if [ "v$oldversion" = "v$version" ]; then
13 echo "Same version - nothing to do"; exit 0;
14fi
15if [ "v$1" = "v-y" ]; then
16 git config user.name github-actions
17 git config user.email github-actions@github.com
18 git tag -a "v$version" -m "Version $version"
19 git push origin "v$version"
20else
21cat <<EOF
22 # the script would do:
23 git tag -a "v$version" -m "Version $version"
24 git push origin "v$version"
25EOF
26fi
27