File tree 2 files changed +30
-13
lines changed
2 files changed +30
-13
lines changed Original file line number Diff line number Diff line change 14
14
- uses : actions/checkout@v3
15
15
with :
16
16
fetch-depth : 3
17
- sparse-checkout : manifest.yaml
17
+ # sparse-checkout: manifest.yaml scripts/auto-release.sh
18
18
19
- - run : |
20
- changes=$(git diff HEAD~1..HEAD -- manifest.yaml | grep 'version:')
21
- oldversion=$(echo "$changes" | grep '^-version:' | cut '-d ' -f2)
22
- version=$(echo "$changes" | grep '^+version:' | cut '-d ' -f2)
23
- echo "Versions: $oldversion --> $version"
24
- if [ "v$oldversion" = "v$version" ]; then
25
- echo "Same version - nothing to do"; exit 0;
26
- fi
27
- git config user.name github-actions
28
- git config user.email github-actions@github.com
29
- git tag -a "v$version" -m "Version $version"
30
- git push origin "v$version"
19
+ - run :
20
+ ${{github.workspace}}/scripts/auto-release.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # this script generates one tag if there is a version change in manifest.yaml
4
+ cd ` dirname $0 `
5
+ if [ " v$1 " = " v-y" ]; then
6
+ echo " production mode!" ;
7
+ fi
8
+ changes=$( git diff HEAD~1..HEAD -- manifest.yaml | grep ' version:' )
9
+ oldversion=$( echo " $changes " | grep ' ^-version:' | cut ' -d ' -f2)
10
+ version=$( echo " $changes " | grep ' ^+version:' | cut ' -d ' -f2)
11
+ echo " Versions: $oldversion --> $version "
12
+ if [ " v$oldversion " = " v$version " ]; then
13
+ echo " Same version - nothing to do" ; exit 0;
14
+ fi
15
+ if [ " 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 "
20
+ else
21
+ echo << EOF
22
+ # the script would do:
23
+ git tag -a "v$version " -m "Version $version "
24
+ git push origin "v$version "
25
+ EOF
26
+ fi
27
+
You can’t perform that action at this time.
0 commit comments