-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,50 @@ jobs: | |
|
||
- name: Check products | ||
run: pipx run twine check dist/* | ||
|
||
test-built-dist: | ||
needs: [dist] | ||
name: Test built distribution | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/[email protected] | ||
name: Install Python | ||
with: | ||
python-version: 3.10 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: releases | ||
path: dist | ||
- name: List contents of built dist | ||
run: | | ||
ls -ltrh | ||
ls -ltrh dist | ||
- name: Publish to Test PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
verbose: true | ||
skip-existing: true | ||
- name: Check pypi packages | ||
run: | | ||
sleep 3 | ||
python -m pip install --upgrade pip | ||
echo "=== Testing wheel file ===" | ||
# Install wheel to get dependencies and check import | ||
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre braingeneers | ||
python -c "import braingeneers; print(braingeneers.__version__)" | ||
echo "=== Done testing wheel file ===" | ||
echo "=== Testing source tar file ===" | ||
# Install tar gz and check import | ||
python -m pip uninstall --yes braingeneers | ||
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre --no-binary=:all: braingeneers | ||
python -c "import braingeneers; print(braingeneers.__version__)" | ||
echo "=== Done testing source tar file ===" | ||
publish: | ||
needs: [dist] | ||
|
@@ -55,8 +99,4 @@ jobs: | |
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
with: | ||
# Remember to tell (test-)pypi about this repo before publishing | ||
# Remove this line to publish to PyPI | ||
repository-url: https://test.pypi.org/legacy/ | ||
if: startsWith(github.ref, 'refs/tags') |