5
5
schedule :
6
6
- cron : ' 0 0 * * *'
7
7
8
+ permissions :
9
+ contents : write
10
+ packages : write
11
+
8
12
jobs :
9
13
upgrade-container-version :
10
14
name : " Upgrade container version"
@@ -24,21 +28,21 @@ jobs:
24
28
with :
25
29
repository : alibaba/tengine
26
30
ref : master
27
- path : int.tmp/repo
31
+ path : int.tmp
28
32
fetch-tags : true
29
33
fetch-depth : 0
30
34
31
35
- name : Check version
32
36
id : check-version
33
37
shell : bash
34
38
run : |
35
- cd int.tmp/repo
39
+ cd int.tmp
36
40
TAG=$(git tag -l '[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -n 1)
37
41
git checkout $TAG
38
42
echo -n "${TAG#v}" > version
39
43
cd ..
40
44
41
- LAST_VERSION=$(cat ./int.tmp/repo/ version)
45
+ LAST_VERSION=$(cat ./int.tmp/version)
42
46
CURRENT_VERSION=$(cat ./tengine/version)
43
47
IFS='.' read -r -a last_version_parts <<< "$LAST_VERSION"
44
48
IFS='.' read -r -a current_version_parts <<< "$CURRENT_VERSION"
@@ -82,13 +86,17 @@ jobs:
82
86
83
87
- name : Build and push container image
84
88
if : steps.check-version.outputs.action == 'update'
85
- run : make push PROJECT=tengine VERSION=${{ needs.check.outputs.action }}
89
+ run : |
90
+ version="${{ steps.check-version.outputs.version }}"
91
+ make push PROJECT=tengine VERSION=$version
86
92
87
93
- name : Git version change and push
88
94
if : steps.check-version.outputs.action == 'update'
89
95
run : |
90
- git config --global user.name "Sebastian Vargas"
91
- git config --global user.email "sebastian.varbel@gmail.com"
96
+ author_name=$(git log -1 --pretty=format:'%an')
97
+ author_email=$(git log -1 --pretty=format:'%ae')
98
+ git config --global user.name "${author_name}"
99
+ git config --global user.email "${author_email}"
92
100
93
101
version="${{ steps.check-version.outputs.version }}"
94
102
echo -n "${version}" > tengine/version
0 commit comments