Skip to content

Release

Release #12

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
force-pypi:
description: Force PyPI
type: boolean
required: false
default: false
force-github:
description: Force GitHub
type: boolean
required: false
default: false
jobs:
release:
name: Release to PyPI
runs-on: ubuntu-latest
concurrency: release
if: github.repository == 'kalekundert/parametrize_from_file'
environment:
name: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
with:
# Make sure the whole repository history is present, so that
# python-semantic-release can decide if a new release is needed.
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Update version
id: semantic-release
uses: python-semantic-release/python-semantic-release@v8.0.8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build sdist/wheel
run: |
python -m pip install build
python -m build
- name: Upload to PyPI
if: inputs.force-pypi || steps.semantic-release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
- name: Upload to GitHub
if: inputs.force-github || steps.semantic-release.outputs.released == 'true'
uses: python-semantic-release/upload-to-gh-release@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}