v0.1.5 #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run release | |
on: | |
# Trigger a beta version release (pre-release) on push to the master branch. | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- "**" # Ignore all tags to prevent duplicate builds when tags are pushed. | |
# Trigger a stable version release when a GitHub release is published. | |
release: | |
types: [published] | |
# Allows manual workflow runs from GitHub's UI, with the ability to specify the type of release. | |
workflow_dispatch: | |
inputs: | |
release_type: | |
description: Release type | |
required: true | |
type: choice | |
default: alpha | |
options: | |
- alpha | |
- beta | |
- final | |
jobs: | |
run_code_checks: | |
name: Run code checks | |
uses: ./.github/workflows/run_code_checks.yaml | |
# This job determines if the conditions are met for a release to occur. It will proceed if triggered manually, | |
# for any published release, or if the commit on push does not begin with "docs" or "chore". | |
should_release: | |
name: Check whether to release | |
if: | | |
github.event_name == 'workflow_dispatch' || | |
github.event_name == 'release' || | |
( | |
github.event_name == 'push' && | |
!startsWith(github.event.head_commit.message, 'docs') && | |
!startsWith(github.event.head_commit.message, 'chore') | |
) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dummy step | |
run: "true" | |
publish_to_pypi: | |
name: Publish to PyPI | |
needs: [run_code_checks, should_release] | |
uses: ./.github/workflows/_publish_to_pypi.yaml |