Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types: [published]
push:
branches:
- master
- main
jobs:
build-publish:
runs-on: ubuntu-latest
Expand All @@ -26,16 +26,15 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install requirements
python-version: "3.10"
- name: Install Hatch
run: |
python -m pip install -r requirements-build.txt
pipx install hatch
pip list

- name: Build package using PDM
- name: Build package using Hatch
run: |
pdm build
hatch build
echo ""
echo "Generated files:"
ls -lh dist/
Expand All @@ -45,15 +44,14 @@ jobs:
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@release/v1
with:
# Haven't setup trusted workflow on test pypi yet
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The weird part here is i'm not sure whether we want to use hatch publish vs just the pypi publish workflow which is easy and i've used before.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to keep pypa/gh-action-pypi-publish

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using hatch to build the wheel and sdist

password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
# Allow existing releases on test PyPI without errors.
# NOT TO BE USED in PyPI!
skip_existing: true
skip-existing: true

- name: Publish package to PyPI
# Only publish to real PyPI on release
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Fix: migrate to pytest for tests and setup hatch scripts (#89, @lwasser)
- Add: Partner support to package (#92, @lwasser)
- Fix: Add validation step to categories attr in pydantic model (#105, @lwasser)
- Fix: update pypi publish to use hatch (#82, @lwasser)

## [v0.15](https://github.com/pyOpenSci/pyosMeta/releases/tag/v0.15)

Expand Down