diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d4b54f..0d904a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: submodules: true - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -41,8 +41,9 @@ jobs: ls -al ./dist - name: Place wheels in artifacts folder - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: + name: windows-${{ matrix.python-version }} path: ./dist/*.whl build_wheels_unix: @@ -59,7 +60,7 @@ jobs: submodules: true - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.11' @@ -78,8 +79,9 @@ jobs: ls -R dist - name: Place wheels in artifacts folder - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: + name: ${{ matrix.os }} path: ./dist/*.whl test-wheels: @@ -97,15 +99,19 @@ jobs: with: submodules: true - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Retrieve packages - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: path: dist + - name: List items + run: | + ls -alR dist + - name: Test Package Installation run: | python -m pip install --upgrade pip @@ -130,35 +136,59 @@ jobs: pip install ${file} python extern/nlopt/test/t_python.py - deploy: - name: deploy packages + deploy-test: + name: Deploy packages to TestPyPI runs-on: ubuntu-latest needs: test-wheels - if: startsWith(github.ref, 'refs/tags/') + if: ${{ !startsWith(github.ref, 'refs/tags/') }} steps: - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Retrieve packages - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: - name: artifact path: dist - name: Install twine run: pip install twine + - name: List directory + run: | + ls -ltR + - name: Upload packages to testpypi env: - TWINE_USERNAME: ${{ secrets.PYPI_TEST_UID }} - TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PWD }} - run: python -m twine upload --skip-existing --repository testpypi dist/* + TWINE_USERNAME: ${{ secrets.PYPI_TEST_TOKEN_NAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }} + run: python -m twine upload --skip-existing --repository testpypi dist/* --verbose + + deploy: + name: Deploy packages to PyPI + runs-on: ubuntu-latest + needs: test-wheels + if: startsWith(github.ref, 'refs/tags/') + + steps: + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Retrieve packages + uses: actions/download-artifact@v4 + with: + name: artifact + path: dist + + - name: Install twine + run: pip install twine - name: Upload packages to pypi env: - TWINE_USERNAME: ${{ secrets.PYPI_UID }} - TWINE_PASSWORD: ${{ secrets.PYPI_PWD }} - run: python -m twine upload --skip-existing dist/* + TWINE_USERNAME: ${{ secrets.PYPI_PROD_TOKEN_NAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PROD_API_TOKEN }} + run: python -m twine upload --skip-existing dist/* --verbose diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..8531a3b --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12.2 diff --git a/extern/nlopt b/extern/nlopt index c40b548..7a7587e 160000 --- a/extern/nlopt +++ b/extern/nlopt @@ -1 +1 @@ -Subproject commit c40b5486c12da6eb994984021bfbfb2ef160cbf6 +Subproject commit 7a7587e5ef1cb15f412515d852d1fc261c863e96 diff --git a/setup.py b/setup.py index f015eb3..c1d96ca 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,6 @@ from extensions import NLOptBuild, NLOptBuildExtension -from wheel.bdist_wheel import bdist_wheel - with open("README.md") as f: long_description = f.read()