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
84 changes: 84 additions & 0 deletions .github/workflows/PyPi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# This workflow will upload a Python Package to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package to PyPI and TestPyPI

on: push

jobs:
release-build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ["3.12"]
- name: Install pypa build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build package (binary wheel and a source tarball)
run: python -m build
- name: Store the distribution package
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

publish-to-pypi:
name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
needs:
- release-build
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
# Dedicated environments with protections for publishing are strongly recommended.
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
environment:
name: pypi
url: https://pypi.org/p/mobilitypy

steps:
- name: Retrieve release distribution
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Publish release distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/

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

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

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

steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: release-dists
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ __Bibliography file:__ Here is the [bibliography file](https://github.com/Semico

<!-- =========================================================== -->
## Version release
__Latest release: v1.0.1__

Chekout out [version release history here](https://github.com/SemiconductorTransport/mobilitypy/wiki/Brief-release-history) for the full list of updates and upgrades.

Expand Down
7 changes: 3 additions & 4 deletions mobilitypy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__version__ = "1.0.1"

from .mobility import AlloyParams, Mobility2DCarrier, Plottings
from .mobility import AlloyParams, Mobility2DCarrier, Mobility3DCarrier, Plottings
from .utilities._quasi3d_plot_fns import PlotQuasi3DFuns

## ==============================================================================
__all__ = ['AlloyParams', 'Mobility2DCarrier', 'Plottings', 'PlotQuasi3DFuns']
__all__ = ['AlloyParams', 'Mobility2DCarrier', 'Mobility3DCarrier',
'Plottings', 'PlotQuasi3DFuns']
Loading