11name : Build DongTai Core Package and push to Ali OSS
22
33on :
4- push :
5- branches : [ "release-*" ]
4+ release :
5+ types : [ created, edited ]
66
77jobs :
88 build :
99 runs-on : ubuntu-latest
10+ permissions :
11+ contents : write
1012
1113 strategy :
1214 max-parallel : 4
@@ -22,25 +24,26 @@ jobs:
2224
2325 - id : release
2426 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"
3330
3431 - name : Generate version file
3532 run : |
3633 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 && \
3835 echo "${{ github.event.repository.name }},commit_hash,${GITHUB_SHA}" >> version.txt \
3936
4037 - name : Replace setup cfg
4138 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 '[email protected] ' 41+ git checkout -b "release-${{ steps.release.outputs.VERSION }}"
42+ sed -i -e 's/version = .*$/version = ${{ steps.release.outputs.VERSION }}/g' setup.cfg
4343 cat setup.cfg
44+ git add .
45+ git commit -m "Update: change version to $NEW_VERSION"
46+ git push "https://$GITHUB_ACTOR:[email protected] /$GITHUB_REPOSITORY.git" HEAD:"release-$NEW_VERSION" 4447
4548 - name : Build DongTai Core Package
4649 run : |
0 commit comments