-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,35 @@ | ||
name: Release to PyPI | ||
|
||
on: | ||
workflow_dispatch: # Allows manual triggering of the workflow | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read # Allows read access to the repository contents | ||
id-token: write # Required for generating OIDC token for authentication with PyPI | ||
contents: read # Required to read repository contents | ||
id-token: write # Required to generate OIDC token for authentication | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Python environment | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
# Step 3: Install required dependencies | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel build | ||
# Step 4: Build the package | ||
- name: Build package | ||
run: | | ||
python -m build | ||
# Step 5: Publish to PyPI using OIDC | ||
- name: Publish to PyPI | ||
- name: Publish to PyPI using OIDC | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://upload.pypi.org/legacy/ | ||
environment: "Any" # Set this to match your environment name in PyPI's pending publisher | ||
environment: "Any" # Match with the environment specified in PyPI |