-
Notifications
You must be signed in to change notification settings - Fork 18
34 lines (31 loc) · 1.06 KB
/
python-publish.yml
File metadata and controls
34 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This workflows will upload a Python Package using Twine when a release is created
# Published via GitHub Actions as a PyPI Trusted Publisher.
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# and: https://docs.pypi.org/trusted-publishers/
name: Upload Python Package
on:
release:
types: [published]
jobs:
deploy:
environment: release-pypi
if: github.repository_owner == 'NatLabRockies'
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies and build package
run: |
python -m pip install --upgrade pip
pip install build twine
python -m build
twine check --strict dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: True