Skip to content

Commit

Permalink
Add tool create release tag pipeline (#127)
Browse files Browse the repository at this point in the history
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
chenslucky and cs_lucky authored Aug 23, 2023
1 parent 27041ed commit 9843eb3
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/tools_release_tag.yml
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

0 comments on commit 9843eb3

Please sign in to comment.