Skip to content

Commit

Permalink
version as 0.0.2 and add release job to push wheels to test PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jun 14, 2024
1 parent a79e1b4 commit d587b5d
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 40 deletions.
101 changes: 63 additions & 38 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,49 +149,74 @@ jobs:
pytest
if: matrix.platform == 'windows-latest'

# - name: Upload wheels as build artifacts (non-windows)
# if: matrix.platform != 'windows-latest'
# run: |
# for wheel_file in dist/*.whl; do
# echo "Uploading $wheel_file"
# echo "::set-output name=wheel_file::$wheel_file"
# echo "::set-output name=artifact_name::$(basename $wheel_file)"
# done
# id: get_wheel_files_nonwindows
#
# - name: Upload wheels as build artifacts (windows)
# if: matrix.platform == 'windows-latest'
# shell: pwsh
# run: |
# foreach ($wheel_file in Get-ChildItem -Path dist -Filter *.whl) {
# Write-Output "Uploading $wheel_file"
# echo "::set-output name=wheel_file::$wheel_file"
# echo "::set-output name=artifact_name::$(Split-Path $wheel_file -Leaf)"
# }
# id: get_wheel_files_windows
#
# - name: Upload wheel file (non-windows)
# if: matrix.platform != 'windows-latest'
# uses: actions/upload-artifact@v4
# with:
# name: ${{ steps.get_wheel_files_nonwindows.outputs.artifact_name }}
# path: ${{ steps.get_wheel_files_nonwindows.outputs.wheel_file }}
#
# - name: Upload wheel file (windows)
# if: matrix.platform == 'windows-latest'
# uses: actions/upload-artifact@v4
# with:
# name: ${{ steps.get_wheel_files_windows.outputs.artifact_name }}
# path: ${{ steps.get_wheel_files_windows.outputs.wheel_file }}

- name: Upload wheels as build artifacts
- name: Upload wheels as build artifacts (non-windows)
if: matrix.platform != 'windows-latest'
run: |
for wheel_file in dist/*.whl; do
echo "Uploading $wheel_file"
echo "::set-output name=wheel_file::$wheel_file"
echo "::set-output name=artifact_name::$(basename $wheel_file)"
done
id: get_wheel_files_nonwindows

- name: Upload wheels as build artifacts (windows)
if: matrix.platform == 'windows-latest'
shell: pwsh
run: |
foreach ($wheel_file in Get-ChildItem -Path dist -Filter *.whl) {
Write-Output "Uploading $wheel_file"
echo "::set-output name=wheel_file::$wheel_file"
echo "::set-output name=artifact_name::$(Split-Path $wheel_file -Leaf)"
}
id: get_wheel_files_windows

- name: Upload wheel file (non-windows)
if: matrix.platform != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.whl
name: ${{ steps.get_wheel_files_nonwindows.outputs.artifact_name }}
path: ${{ steps.get_wheel_files_nonwindows.outputs.wheel_file }}

- name: Upload wheel file (windows)
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_wheel_files_windows.outputs.artifact_name }}
path: ${{ steps.get_wheel_files_windows.outputs.wheel_file }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

publish-to-pypi:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment: pypi
permissions:
id-token: write

steps:
- name: download all artifacts (wheels and executables)
uses: actions/download-artifact@v4
with:
path: dist_temp/

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.12'

- name: Publish wheels to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
run: |
pip install twine
find dist_temp -name '*.whl' -exec mv {} dist \;
twine upload --repository testpypi dist/*.whl
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "pyvcell_fvsolver"
version = "0.0.1"
version = "0.0.2"
description="Virtual Cell Finite Volume PDE solver"
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def test_version():
assert fv.__version__ == "0.0.1"
assert fv.__version__ == "0.0.2"


def test_version_function():
Expand Down

0 comments on commit d587b5d

Please sign in to comment.