diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 001b806d7..3bdc1376e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,6 +3,35 @@ name: Release "on": push: branches: ["main", "master", "release/**"] + workflow_dispatch: + inputs: + release_force: + # see https://python-semantic-release.readthedocs.io/en/latest/github-action.html#command-line-options + description: | + Force release be one of: [major | minor | patch] + Leave empty for auto-detect based on commit messages. + type: choice + options: + - "" # auto - no force + - major # force major + - minor # force minor + - patch # force patch + default: "" + required: false + prerelease_token: + description: 'The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the rc in `1.2.0-rc.8`.' + type: choice + options: + - rc + - beta + - alpha + default: rc + required: false + prerelease: + description: "Is a pre-release" + type: boolean + default: false + required: false concurrency: group: deploy @@ -48,18 +77,23 @@ jobs: venv-${{ runner.os }}-\ ${{ env.PYTHON_VERSION_DEFAULT }}-\ ${{ hashFiles('**/poetry.lock') }} + - name: Validate project dependencies run: poetry check + - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root + - name: Python Semantic Release id: release - run: | - poetry run semantic-release publish - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # PyPI_TOKEN: ${{secrets.PyPI_TOKEN}} + uses: python-semantic-release/python-semantic-release@v8.3.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + force: ${{ github.event.inputs.release_force }} + prerelease: ${{ github.event.inputs.prerelease }} + prerelease_token: ${{ github.event.inputs.prerelease_token }} + - name: Publish package distributions to GitHub Releases if: steps.release.outputs.released == 'true' # see https://github.com/python-semantic-release/upload-to-gh-release