From 5d7267783901afe67f8126359727a44edc9fab2d Mon Sep 17 00:00:00 2001 From: Daniel Bok Date: Wed, 3 Apr 2024 08:28:17 +0800 Subject: [PATCH 1/4] Update nlopt submodule --- .python-version | 1 + extern/nlopt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .python-version 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 From f9174ccfe2fbca71bb8737ab78354fda8899de32 Mon Sep 17 00:00:00 2001 From: Daniel Bok Date: Wed, 3 Apr 2024 08:28:41 +0800 Subject: [PATCH 2/4] update build --- .github/workflows/build.yml | 63 +++++++++++++++++++++++++++---------- setup.py | 2 -- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d4b54f..1d4ee0d 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,7 +41,7 @@ jobs: ls -al ./dist - name: Place wheels in artifacts folder - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: path: ./dist/*.whl @@ -59,7 +59,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,7 +78,7 @@ jobs: ls -R dist - name: Place wheels in artifacts folder - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: path: ./dist/*.whl @@ -97,12 +97,12 @@ 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 @@ -130,20 +130,24 @@ 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: Setup Python ${{ matrix.python-version }} + 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 @@ -151,14 +155,39 @@ jobs: - 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/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() From b4f19865258f07312e87cd9805c69ff8f37cbd83 Mon Sep 17 00:00:00 2001 From: Daniel Bok Date: Wed, 3 Apr 2024 08:51:03 +0800 Subject: [PATCH 3/4] update build --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d4ee0d..f5ae7ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,7 @@ jobs: - name: Place wheels in artifacts folder uses: actions/upload-artifact@v4 with: + name: windows-${{ matrix.python-version }} path: ./dist/*.whl build_wheels_unix: @@ -80,6 +81,7 @@ jobs: - name: Place wheels in artifacts folder uses: actions/upload-artifact@v4 with: + name: ${{ matrix.os }}-${{ matrix.python-version }} path: ./dist/*.whl test-wheels: @@ -106,6 +108,10 @@ jobs: with: path: dist + - name: List items + run: | + ls -alR dist + - name: Test Package Installation run: | python -m pip install --upgrade pip From ba57e9a793ee53bd43a359b58b63eebf18667e52 Mon Sep 17 00:00:00 2001 From: Daniel Bok Date: Wed, 3 Apr 2024 08:59:14 +0800 Subject: [PATCH 4/4] update build --- .github/workflows/build.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5ae7ce..0d904a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,7 +81,7 @@ jobs: - name: Place wheels in artifacts folder uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os }}-${{ matrix.python-version }} + name: ${{ matrix.os }} path: ./dist/*.whl test-wheels: @@ -147,15 +147,10 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - 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