Skip to content

Commit

Permalink
Fix pypi workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
aymgal committed Jul 30, 2024
1 parent a851b6a commit 00eac00
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 34 deletions.
59 changes: 43 additions & 16 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,52 @@
name: Publish to PyPi
name: Publish to PyPI

on: workflow_dispatch

jobs:
build-and-publish:
name: Build python package and publish to PyPi
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- 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@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish distribution to PyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/herculens

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- uses: actions/checkout@master
- name: Set up Python 3.11
uses: actions/setup-python@v2
- name: Download the dists
uses: actions/download-artifact@v3
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish to PyPi
name: python-package-distributions
path: dist/
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://pypi.org/legacy/
60 changes: 43 additions & 17 deletions .github/workflows/publish-to-testpypi.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
name: Publish to Test PyPi
name: Publish to Test PyPI

on: workflow_dispatch

jobs:
build-and-publish:
name: Build python package and publish to Test PyPi
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- 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@v3
with:
name: python-package-distributions
path: dist/

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

environment:
name: testpypi
url: https://test.pypi.org/p/herculens

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- uses: actions/checkout@master
- name: Set up Python 3.11
uses: actions/setup-python@v2
- name: Download the dists
uses: actions/download-artifact@v3
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish to Test PyPi
name: python-package-distributions
path: dist/
- name: Upload to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Changelog

## 0.1.0 (2024-07-30)
++++++++++++++++++

* First release on PyPI.

0 comments on commit 00eac00

Please sign in to comment.