-
Notifications
You must be signed in to change notification settings - Fork 872
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
27041ed
commit 9843eb3
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Promptflow Tools Release Tag | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
TagVersion: | ||
description: 'Tag version' | ||
required: true | ||
default: 'v1.0.0' | ||
type: string | ||
ReleaseName: | ||
description: 'Release name' | ||
required: true | ||
default: 'v1.0.0' | ||
type: string | ||
PreRelease: | ||
description: 'Whether it is a pre-release' | ||
required: true | ||
default: true | ||
type: boolean | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get last tag version | ||
run: | | ||
version=$(git tag | tail -1) | ||
echo "last_tag_version=$version" >> $GITHUB_ENV | ||
- name: Generate release notes | ||
run: | | ||
echo "# **What's Changed**" > ./src/promptflow-tools/CHANGELOG.md | ||
git log ${{ env.last_tag_version }}.. --pretty=format:"%H %s @%an" -- ./src/promptflow-tools/ >> ./src/promptflow-tools/CHANGELOG.md | ||
echo " " >> ./src/promptflow-tools/CHANGELOG.md | ||
echo " " >> ./src/promptflow-tools/CHANGELOG.md | ||
echo "**Full Changelog**: https://github.com/microsoft/promptflow/compare/${{ env.last_tag_version }}...${{ inputs.TagVersion }}" >> ./src/promptflow-tools/CHANGELOG.md | ||
- name: Zip folder | ||
run: | | ||
cd src | ||
zip -r promptflow-tools.zip promptflow-tools | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ inputs.TagVersion }} | ||
release_name: ${{ inputs.ReleaseName }} | ||
body_path: ./src/promptflow-tools/CHANGELOG.md | ||
draft: false | ||
prerelease: ${{ inputs.PreRelease }} | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./src/promptflow-tools.zip | ||
asset_name: promptflow-tools.zip | ||
asset_content_type: application/zip |