1
+ name : Promptflow Tools Release Tag
2
+ on :
3
+ workflow_dispatch :
4
+ inputs :
5
+ TagVersion :
6
+ description : ' Tag version'
7
+ required : true
8
+ default : ' v1.0.0'
9
+ type : string
10
+ ReleaseName :
11
+ description : ' Release name'
12
+ required : true
13
+ default : ' v1.0.0'
14
+ type : string
15
+ PreRelease :
16
+ description : ' Whether it is a pre-release'
17
+ required : true
18
+ default : true
19
+ type : boolean
20
+
21
+ jobs :
22
+ build :
23
+ runs-on : ubuntu-latest
24
+ steps :
25
+ - name : Checkout code
26
+ uses : actions/checkout@v3
27
+ with :
28
+ fetch-depth : 0
29
+
30
+ - name : Get last tag version
31
+ run : |
32
+ version=$(git tag | tail -1)
33
+ echo "last_tag_version=$version" >> $GITHUB_ENV
34
+
35
+ - name : Generate release notes
36
+ run : |
37
+ echo "# **What's Changed**" > ./src/promptflow-tools/CHANGELOG.md
38
+ git log ${{ env.last_tag_version }}.. --pretty=format:"%H %s @%an" -- ./src/promptflow-tools/ >> ./src/promptflow-tools/CHANGELOG.md
39
+ echo " " >> ./src/promptflow-tools/CHANGELOG.md
40
+ echo " " >> ./src/promptflow-tools/CHANGELOG.md
41
+ echo "**Full Changelog**: https://github.com/microsoft/promptflow/compare/${{ env.last_tag_version }}...${{ inputs.TagVersion }}" >> ./src/promptflow-tools/CHANGELOG.md
42
+
43
+ - name : Zip folder
44
+ run : |
45
+ cd src
46
+ zip -r promptflow-tools.zip promptflow-tools
47
+
48
+ - name : Create Release
49
+ id : create_release
50
+ uses : actions/create-release@v1
51
+ env :
52
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53
+ with :
54
+ tag_name : ${{ inputs.TagVersion }}
55
+ release_name : ${{ inputs.ReleaseName }}
56
+ body_path : ./src/promptflow-tools/CHANGELOG.md
57
+ draft : false
58
+ prerelease : ${{ inputs.PreRelease }}
59
+
60
+ - name : Upload Release Asset
61
+ id : upload-release-asset
62
+ uses : actions/upload-release-asset@v1
63
+ env :
64
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65
+ with :
66
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
67
+ asset_path : ./src/promptflow-tools.zip
68
+ asset_name : promptflow-tools.zip
69
+ asset_content_type : application/zip
0 commit comments