Skip to content

Release v1.1.5

Release v1.1.5 #7

Workflow file for this run

name: Upload Python Package
on:
release:
types: [published] # Trigger only when a release is published
permissions:
contents: read
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # Clone the repo
- uses: actions/setup-python@v5
with:
python-version: "3.x" # Uses latest Python 3.x
- name: Install build tools
run: |
python -m pip install --upgrade build # Install the 'build' package
- name: Build release distributions
run: |
python -m build # Build .whl and .tar.gz files and store them in the dist/ directory
- name: Upload distributions as artifacts
uses: actions/upload-artifact@v4
with:
name: release-dists # Name of the artifact
path: dist/ # Path to upload
pypi-publish:
runs-on: ubuntu-latest
needs: release-build # Wait for the build job to finish
permissions:
id-token: write # Required for PyPI publishing
environment:
name: pypi
url: https://pypi.org/project/AnimeScraper/ # Your project's URL on PyPI
steps:
- name: Retrieve built distributions
uses: actions/download-artifact@v4
with:
name: release-dists # Download the artifact from the build step
path: dist/ # Download location
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/ # Directory containing the .whl and .tar.gz files
env:
TWINE_USERNAME: __token__ # Username for PyPI (always __token__ for token-based authentication)
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Reference the PyPI token from GitHub Secrets