diff --git a/.github/workflows/cbuild.yml b/.github/workflows/cbuild.yml new file mode 100644 index 0000000..3b5058c --- /dev/null +++ b/.github/workflows/cbuild.yml @@ -0,0 +1,68 @@ +name: cBuild + +# Build on every branch push, tag push, and pull request change: +#on: [push] +# Alternatively, to publish when a (published) GitHub Release is created, use the following: +on: + push: + branches: + - main + - develop + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.19.1 + env: + # Disable building PyPy wheels on all platforms + CIBW_SKIP: pp* + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/.github/workflows/cibuild-pypi.yml b/.github/workflows/cibuild-pypi.yml index b690acd..b7e2043 100644 --- a/.github/workflows/cibuild-pypi.yml +++ b/.github/workflows/cibuild-pypi.yml @@ -1,4 +1,4 @@ -name: Build and upload to PyPI +name: cBuild and upload to PyPI # Build on every branch push, tag push, and pull request change: #on: [push] @@ -19,45 +19,52 @@ jobs: os: [ubuntu-latest, windows-latest, macos-13, macos-14] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build wheels uses: pypa/cibuildwheel@v2.19.1 + env: + # Disable building PyPy wheels on all platforms + CIBW_SKIP: pp* - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl build_sdist: name: Build source distribution runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-sdist path: dist/*.tar.gz upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - # upload to PyPI on every tag starting with 'v' - #if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - # alternatively, to publish when a GitHub Release is created, use the following rule: - # if: github.event_name == 'release' && github.event.action == 'published' + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - # unpacks default artifact into dist/ - # if `name: artifact` is omitted, the action will create extra parent dir - name: artifact + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* path: dist + merge-multiple: true - - uses: pypa/gh-action-pypi-publish@v1.5.0 + - uses: pypa/gh-action-pypi-publish@release/v1 with: - user: ${{ secrets.pypi_username }} + user: __token__ password: ${{ secrets.pypi_password }} repository_url: https://upload.pypi.org/legacy/ \ No newline at end of file diff --git a/setup.py b/setup.py index a501ba1..8cdaac9 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ name="spectresc", maintainer="Marco C Lam", maintainer_email="mlam@roe.ac.uk", - version="1.0.3", + version="1.0.4", install_requires=[ "numpy", ], @@ -22,7 +22,6 @@ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: C", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10",