1
1
name : Build DongTai Core Package and push to Ali OSS
2
2
3
3
on :
4
- push :
5
- branches : [ "release-*" ]
4
+ release :
5
+ types : [ created, edited ]
6
6
7
7
jobs :
8
8
build :
9
9
runs-on : ubuntu-latest
10
+ permissions :
11
+ contents : write
10
12
11
13
strategy :
12
14
max-parallel : 4
@@ -22,25 +24,26 @@ jobs:
22
24
23
25
- id : release
24
26
run : |
25
- VERSION=`echo ${GITHUB_REF##*/} | awk -F'-' '{print $2}'`
26
- echo "::set-output name=VERSION::$VERSION"
27
-
28
- - name : Get release version
29
- id : get_release_version
30
- run : |
31
- V=`echo ${{ steps.release.outputs.VERSION }} | sed -e's/v//g' | sed -e's/V//g'`; \
32
- echo ::set-output name=VERSION::${V}
27
+ TAG_NAME=${{ github.event.release.tag_name }}
28
+ ID=`echo ${TAG_NAME##v}`
29
+ echo "::set-output name=VERSION::$ID"
33
30
34
31
- name : Generate version file
35
32
run : |
36
33
cd ${{ github.workspace }} && \
37
- echo "${{ github.event.repository.name }},version,${{ steps.get_release_version .outputs.VERSION }}" >> version.txt && \
34
+ echo "${{ github.event.repository.name }},version,${{ steps.release .outputs.VERSION }}" >> version.txt && \
38
35
echo "${{ github.event.repository.name }},commit_hash,${GITHUB_SHA}" >> version.txt \
39
36
40
37
- name : Replace setup cfg
41
38
run : |
42
- sed -i -e 's/version = .*$/version = ${{ steps.get_release_version.outputs.VERSION }}/g' setup.cfg
39
+ git config --global user.name 'exexute'
40
+ git config --global user.email '1528360120@qq.com'
41
+ git checkout -b "release-${{ steps.release.outputs.VERSION }}"
42
+ sed -i -e 's/version = .*$/version = ${{ steps.release.outputs.VERSION }}/g' setup.cfg
43
43
cat setup.cfg
44
+ git add .
45
+ git commit -m "Update: change version to $NEW_VERSION"
46
+ git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:"release-$NEW_VERSION"
44
47
45
48
- name : Build DongTai Core Package
46
49
run : |
0 commit comments