diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3df316e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +name: Release + +on: + push: + tags: + - v* + +concurrency: + group: release + +env: + PYTHONUNBUFFERED: "1" + FORCE_COLOR: "1" + +jobs: + publish-pypi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: true + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: Install Hatch + run: pip install --upgrade hatch + + - name: Build package + run: hatch build + + - name: Push Python artifacts to PyPI + uses: pypa/gh-action-pypi-publish@v1.8.10 + + publish-github: + needs: publish-pypi + runs-on: ubuntu-latest + + permissions: + id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get version from tag + id: get-version + uses: battila7/get-version-action@v2 + + - name: Get changelog release info + id: changelog + uses: release-flow/keep-a-changelog-action@v2 + with: + command: query + version: ${{ steps.get-version.outputs.version-without-v }} + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + name: ${{ steps.changelog.outputs.version }} + body: ${{ steps.changelog.outputs.release-notes }} \ No newline at end of file