Skip to content

Commit

Permalink
[promptflow][fundamental] Update create tag workflow to also create a…
Browse files Browse the repository at this point in the history
… release (#1082)

# Description

Update workflow [Create promptflow release
tag](https://github.com/microsoft/promptflow/actions/workflows/create_promptflow_release_tag.yml)
to also create a release for promptflow, which will be shown in
[Releases](https://github.com/microsoft/promptflow/releases) page.

# All Promptflow Contribution checklist:
- [x] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [x] Title of the pull request is clear and informative.
- [x] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.
  • Loading branch information
zhengfeiwang committed Nov 10, 2023
1 parent 612ceaa commit f1fc08b
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/create_promptflow_release_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Create promptflow release tag

on:
workflow_dispatch:
inputs:
release_version:
description: "Release version"
required: true
type: string

jobs:
create_release_tag:
Expand All @@ -11,6 +16,7 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v2

- name: create branch
run: |
set -x -e
Expand Down Expand Up @@ -39,3 +45,41 @@ jobs:
git tag promptflow_$release_version
git push origin --tags
# write environment variable to `GITHUB_ENV` to pass values between steps
# https://docs.github.com/en/github-ae@latest/actions/learn-github-actions/variables#passing-values-between-steps-and-jobs-in-a-workflow
echo "release_version=$release_version" >> "$GITHUB_ENV"
echo "release_tag=$release_tag" >> "$GITHUB_ENV"
- name: create asset
run: |
cd src
tar -czvf promptflow-$release_version.tar.gz promptflow
- name: create release note
run: |
cp ./scripts/release/promptflow-release-note.md ./src/promptflow/release_note.md
sed -i "s/{{VERSION}}/$release_version/g" ./src/promptflow/release_note.md
cat ./src/promptflow/release_note.md
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: promptflow_${{ inputs.release_version }}
release_name: promptflow ${{ inputs.release_version }}
body_path: ./src/promptflow/release_note.md
draft: false
prerelease: false

- name: upload 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-${{ inputs.release_version }}.tar.gz
asset_name: promptflow-${{ inputs.release_version }}.tar.gz
asset_content_type: application/gzip
15 changes: 15 additions & 0 deletions scripts/release/promptflow-release-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
We are pleased to announce the release of promptflow {{VERSION}}.

This release includes some new features, bug fixes, and improvements. We recommend that all users upgrade to this version.

See the [CHANGELOG](https://github.com/microsoft/promptflow/blob/release/promptflow/{{VERSION}}/src/promptflow/CHANGELOG.md) for a list of all the changes.

The release will be available via PyPI:

```bash
pip install --upgrade promptflow
```

Please report any issues with the release on the [promptflow issue tracker](https://github.com/microsoft/promptflow/issues).

Thanks to all the contributors who made this release possible.

0 comments on commit f1fc08b

Please sign in to comment.