Skip to content

Releasing

Releasing #109

Workflow file for this run

name: Build & Release
run-name: "Releasing"
on:
pull_request:
branches:
- main
types:
- closed
jobs:
generate-version:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.version.outputs.version }}
steps:
- name: Github Checkout
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install hatch
run: |
pip install hatch
- name: Get Version
id: version
run: |
echo "version=$(hatch version)" >> $GITHUB_OUTPUT
publish:
runs-on: ubuntu-latest
needs:
- generate-version
permissions:
contents: write
steps:
- name: Github Checkout
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Release
# v1.14.0
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5
with:
tag: ${{ needs.generate-version.outputs.new_version }}
generateReleaseNotes: true
draft: false
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install hatch
run: |
pip install hatch
- name: Build SDK
run: |
hatch build
- name: Publish Python 🐍 distributions 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}