Skip to content

Commit 9843eb3

Browse files
chensluckycs_lucky
and
cs_lucky
authored
Add tool create release tag pipeline (#127)
Add a pipeline to create release tag for promptflow-tools. **Template example**: ![image](https://github.com/microsoft/promptflow/assets/75061414/3a4b1c6e-ddef-424b-b313-4f861698e50a) --------- Co-authored-by: cs_lucky <si.chen@microsoft.com>
1 parent 27041ed commit 9843eb3

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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

Comments
 (0)