Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitro4542 committed Sep 6, 2024
2 parents 6d068f5 + 5fbab57 commit 7de1c8f
Showing 1 changed file with 47 additions and 17 deletions.
64 changes: 47 additions & 17 deletions .github/workflows/testpypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
name: Upload Python Package
name: Publish Python 🐍 distribution πŸ“¦ to PyPI and TestPyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
pypi-publish:
name: upload release to PyPI
build:
name: Build distribution πŸ“¦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-testpypi:
name: Publish Python 🐍 distribution πŸ“¦ to TestPyPI
needs:
- build
runs-on: ubuntu-latest
environment: release

environment:
name: testpypi
url: https://test.pypi.org/p/desktop-groups

permissions:
id-token: write

steps:
- name: Prepare dependencies
run: python -m pip install --upgrade pip setuptools wheel build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
username: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- 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/
username: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}

0 comments on commit 7de1c8f

Please sign in to comment.