Update pythonpublish.yml

Updated to use pypi Trusted Publisher.
This commit is contained in:
Jamie Hardt
2023-05-31 18:53:46 -07:00
committed by GitHub
parent 51ed92f5df
commit b78ae05d8c

View File

@@ -2,30 +2,32 @@ name: Upload Python Package
on: on:
release: release:
types: [created] types: [published]
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
id-token: write
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: release
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v1 uses: actions/setup-python@v3
with: with:
python-version: '3.x' python-version: '3.x'
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install setuptools wheel twine pip install build
- name: Build and publish - name: Build package
env: run: python -m build
TWINE_USERNAME: __token__ - name: pypi-publish
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} uses: pypa/gh-action-pypi-publish@v1.8.6
run: |
python -m build .
twine upload dist/*
- name: Report to Mastodon - name: Report to Mastodon
uses: cbrgm/mastodon-github-action@v1.0.1 uses: cbrgm/mastodon-github-action@v1.0.1
with: with: