Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
inputs:
dry_run:
description: 'Run semantic-release in dry-run mode'
required: false
type: boolean
default: true
publish:
description: 'Publish to pypi.org'
required: false
type: boolean
default: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -65,7 +72,8 @@ jobs:
needs: semantic-release
runs-on: ubuntu-latest
timeout-minutes: 30
if: (github.ref_name == 'main' && github.event_name == 'push') || (github.ref_name == 'main' && github.event_name == 'workflow_dispatch' && !inputs.dry_run)
# Only publish after semantic-release has created a new tag
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && !inputs.dry_run && inputs.publish)

permissions:
contents: read
Expand All @@ -90,6 +98,7 @@ jobs:
run: make build-dist

# Requires TWINE_TOKEN to be configured in repo secrets
# TODO remove "with: password" using TWINE_TOKEN once trusted publisher config is fixed
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down