From bb2a539227f47cb78f591b98d1114d2c55e6aa47 Mon Sep 17 00:00:00 2001 From: Alex Kaszynski Date: Thu, 2 Nov 2023 22:41:02 -0600 Subject: [PATCH 1/2] add py.typed (#18) --- mapdl_archive/py.typed | 1 + setup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 mapdl_archive/py.typed diff --git a/mapdl_archive/py.typed b/mapdl_archive/py.typed new file mode 100644 index 0000000..5fcb852 --- /dev/null +++ b/mapdl_archive/py.typed @@ -0,0 +1 @@ +partial \ No newline at end of file diff --git a/setup.py b/setup.py index a683e05..819af84 100644 --- a/setup.py +++ b/setup.py @@ -77,11 +77,12 @@ python_requires=">=3.8", keywords="vtk MAPDL ANSYS cdb", package_data={ + "mapdl_archive": ["py.typed"], "mapdl_archive.examples": [ "TetBeam.cdb", "HexBeam.cdb", "sector.cdb", - ] + ], }, install_requires=["pyvista>=0.41.1"], ) From 78e0523e5ccf2448128c195c57542023b527cabb Mon Sep 17 00:00:00 2001 From: Alex Kaszynski Date: Thu, 2 Nov 2023 22:51:33 -0600 Subject: [PATCH 2/2] use trusted publishing (#19) --- .github/workflows/testing-and-deployment.yml | 33 +++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index c65d4ac..6d23d5c 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -105,34 +105,29 @@ jobs: with: path: ./wheelhouse/*.whl - Release: + release: + name: Release if: github.event_name == 'push' && contains(github.ref, 'refs/tags') needs: [build, mac_build] runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/mapdl-archive + permissions: + id-token: write # this permission is mandatory for trusted publishing steps: - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - # this downloads all artifacts - uses: actions/download-artifact@v3 - - name: Display structure of downloaded files run: ls -R - - - name: Upload to Public PyPi + - name: Move wheels to dist run: | - pip install twine - twine upload --skip-existing ./**/*.whl - twine upload --skip-existing ./**/*.tar.gz - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - - - name: Release + mkdir -p dist/ + find . -name "*.whl" -exec mv {} dist/ \; + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: generate_release_notes: true files: | - ./**/*.whl \ No newline at end of file + ./**/*.whl