Skip to content

ci: create-new-release.yml - replace create-release action #16

ci: create-new-release.yml - replace create-release action

ci: create-new-release.yml - replace create-release action #16

name: Create new release
on:
pull_request:
branches:
- main
types:
- closed
push:
jobs:
push-tag:
name: Push a tag
# if: ${{ contains(github.event.pull_request.labels.*.name, 'new release') && github.event.pull_request.merged }}
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag: ${{ steps.tag.outputs.value }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Configure git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Push a tag
id: tag
run: |
tag="v$(hatch version)"
git tag -a ${tag} -m "New release ${tag} (tagged by github-actions[bot])"
git push origin ${tag}
echo "value=${tag}" >> $GITHUB_OUTPUT
create-release:
name: Create a release
runs-on: ubuntu-latest
needs: push-tag
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create a release
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ steps.tag.outputs.value }}
generate_release_notes: true