Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
AmelieJB committed Dec 3, 2024
1 parent 1ef159a commit b774b44
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
name: Publish Python distribution to TestPyPI
name: Publish Python distribution to PyPI

on: push
on:
push:
tags:
- 'v*'

jobs:

publish-to-testpypi:
name: Publish Python distribution to TestPyPI
needs:
- build
build-and-publish:
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/<package-name>
steps:
- name: Check out the code
uses: actions/checkout@v3

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: 3.9

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build the package
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*

0 comments on commit b774b44

Please sign in to comment.