summaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: 50695b14dc050844338bc25e4c4f84e4e715f8db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Release

on:
  workflow_dispatch:
    inputs:
      tag:
        description: "Release Tag WITHOUT `v` Prefix (e.g. 6.0.0)"
        required: true
      dry-run:
        description: 'Dry run'
        required: false
        type: boolean
        default: true

jobs:
  publish:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3

      - uses: actions/setup-python@v4
        with:
          python-version: '3.10'

      - run: python setup.py sdist bdist_wheel
        env:
          SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DOCKER: ${{ inputs.tag }}

      - name: Publish to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        if: ! inputs.dry-run
        with:
          password: ${{ secrets.PYPI_API_TOKEN }}

      - name: Create GitHub release
        uses: ncipollo/release-action@v1
        if: ! inputs.dry-run
        with:
          artifacts: "dist/*"
          generateReleaseNotes: true
          draft: true
          commit: ${{ github.sha }}
          token: ${{ secrets.GITHUB_TOKEN }}
          tag: ${{ inputs.tag }}