Skip to content

feat: Github actions with pypi trusted publisher #7

feat: Github actions with pypi trusted publisher

feat: Github actions with pypi trusted publisher #7

Workflow file for this run

on:
push:
tags:
- '*'
jobs:
build:
uses: ./.github/workflows/build.yml
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
needs: ["build"]
# Specifying a GitHub environment is optional, but strongly encouraged
environment: publish_pypi
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Fetch Artifacts
uses: actions/download-artifact@v4
with:
name: build-artifact
path: ./dist
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# retrieve your distributions here
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1