Release version to 0.8.0 #73
Workflow file for this run
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
name: Create Release Tag and Notes | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
create_release: | |
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Get last release tag | |
id: last_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
LAST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | |
echo "LAST_TAG=$LAST_TAG" >> $GITHUB_ENV | |
- name: Get current version | |
id: current_version | |
run: | | |
RELEASE_TAG=$(poetry version --short) | |
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | |
- name: Generate release note | |
id: release_note | |
run: | | |
RELEASE_NOTE=$(curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/generate-notes -d '{"tag_name":"${{ env.RELEASE_TAG }}", "previous_tag_name":"${{ env.LAST_TAG }}"}' | jq .body | sed 's/"//g') | |
echo -e "$RELEASE_NOTE" > release_note.txt | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.RELEASE_TAG }} | |
release_name: Release v${{ env.RELEASE_TAG }} | |
draft: false | |
prerelease: false | |
body_path: release_note.txt |