Publish Python distributions to PyPI #1
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: Publish Python distributions to PyPI | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-n-publish: | |
if: ${{ github.repository == 'slaclab/lume-model' }} | |
name: Build and publish Python distributions to PyPI | |
runs-on: ubuntu-latest | |
environment: deployment | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install build | |
run: | | |
python -m pip install build | |
- name: Build a source tarball | |
run: | | |
sudo python3 -m build | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |