Skip to content

Commit

Permalink
Use test pypi for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFizzyBubbs committed Dec 10, 2024
1 parent 477e31d commit eec47c6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Publish to PyPI
on:
workflow_dispatch:
release:
types: [published]
jobs:
Expand Down Expand Up @@ -31,22 +30,22 @@ jobs:
with:
name: dist
path: dist/
# publish:
# needs: build
# runs-on: ubuntu-latest
# environment:
# name: pypi
# url: https://pypi.org/p/pymafia
# permissions:
# # Required for PyPI's trusted publishing
# id-token: write
# steps:
# - name: Download distributions
# uses: actions/download-artifact@v4
# with:
# name: dist
# path: dist/
# - name: Publish to PyPI
# # `--trusted-publishing always` is recommended for debugging as it show errors earlier when there is a problem
# # See https://github.com/astral-sh/uv/issues/8584#issuecomment-2440923698
# uses: uv publish --trusted-publishing always
publish:
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pymafia
permissions:
# Required for PyPI's trusted publishing
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
# `--trusted-publishing always` is recommended for debugging as it show errors earlier when there is a problem
# See https://github.com/astral-sh/uv/issues/8584#issuecomment-2440923698
uses: uv publish --trusted-publishing always
12 changes: 4 additions & 8 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v5
- name: Build package
run: uv build
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version-file: .java-version
distribution: temurin
- name: Validate distributions
run: |
for file in $(find dist -type f); do
echo "Validating $file"
uv run --with $file --no-project --refresh-package pymafia -- python -c "import pymafia"
done
- name: Smoke test (wheel)
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py -- python -c "import pymafia"
- name: Smoke test (source distribution)
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py -- python -c "import pymafia"
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit eec47c6

Please sign in to comment.