From 335a1b9a24a99363838529b609fb40048ce4f22e Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 09:10:47 +0100 Subject: [PATCH 01/16] fix artifact name collisions --- .github/workflows/wheels.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b1cdadd..55a9050 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -38,7 +38,7 @@ jobs: name: Build SDist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true @@ -50,6 +50,7 @@ jobs: - uses: actions/upload-artifact@v4 with: + name: sdist-artifact-${{strategy.job-index}} path: dist/*.tar.gz build_wheels: @@ -61,7 +62,7 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true @@ -74,6 +75,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: + name: wheelhouse-${{strategy.job-index}} path: wheelhouse/*.whl upload_all: @@ -87,12 +89,13 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: artifact path: dist + merge-multiple: true - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From 3e65e461210d759cf2d861778ab10722e7d0e2bb Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 11:51:01 +0100 Subject: [PATCH 02/16] update wheel publishing pipeline --- .github/workflows/wheels.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 55a9050..d45d72e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -82,7 +82,8 @@ jobs: name: Upload if release needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' + # run on published release or manual trigger + if: github.event_name == 'release' && github.event.action == 'published' || github.event_name == 'workflow_dispatch' permissions: # Added OIDC permissions contents: read # Gemini suggested this, I'm not sure if this is necessary @@ -93,9 +94,25 @@ jobs: - uses: actions/download-artifact@v4 with: - name: artifact - path: dist + pattern: '**.whl' # Download all wheels + name: wheelhouse + merge-multiple: true + + - uses: actions/download-artifact@v4 + with: + pattern: '**.tar.gz' # Download all dist + name: dist merge-multiple: true - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + + # use test pypi or real pypi depending on the release tag + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + repository_url: # test pypi if manually triggered, else pypi + ${{ github.event_name == 'workflow_dispatch' && 'https://test.pypi.org/simple/' || 'https://upload.pypi.org/simple/' }} + test: false + skip_existing: true + distributions: dist/*.tar.gz wheelhouse/*.whl From 9ddb0d7111669237e3304428465a9c9cb9cca34d Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 12:34:19 +0100 Subject: [PATCH 03/16] make testing faster --- .github/workflows/wheels.yml | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d45d72e..892cc8e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -14,7 +14,9 @@ env: # Python 3.12+ is handled using the stable ABI, no need to build later versions CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8, <=3.12" # Only build for PyPy 3.9 - CIBW_SKIP: "pp37* pp38*" + # CIBW_SKIP: "pp37* pp38*" + CIBW_BUILD: "cp310-manylinux_x86_64" # for testing, build single wheel. + # Target 64 bit architectures (x86_64, and arm64 on macOS) CIBW_ARCHS_WINDOWS: auto64 CIBW_ARCHS_LINUX: auto64 @@ -50,7 +52,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: sdist-artifact-${{strategy.job-index}} + name: cibw-sdist path: dist/*.tar.gz build_wheels: @@ -78,7 +80,7 @@ jobs: name: wheelhouse-${{strategy.job-index}} path: wheelhouse/*.whl - upload_all: + upload_to_pypi: name: Upload if release needs: [build_wheels, build_sdist] runs-on: ubuntu-latest @@ -86,7 +88,7 @@ jobs: if: github.event_name == 'release' && github.event.action == 'published' || github.event_name == 'workflow_dispatch' permissions: # Added OIDC permissions - contents: read # Gemini suggested this, I'm not sure if this is necessary + contents: read id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: @@ -94,25 +96,9 @@ jobs: - uses: actions/download-artifact@v4 with: - pattern: '**.whl' # Download all wheels - name: wheelhouse - merge-multiple: true - - - uses: actions/download-artifact@v4 - with: - pattern: '**.tar.gz' # Download all dist - name: dist - merge-multiple: true + pattern: cibw-* + path: dist + merge-multiple: true - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - - # use test pypi or real pypi depending on the release tag - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - repository_url: # test pypi if manually triggered, else pypi - ${{ github.event_name == 'workflow_dispatch' && 'https://test.pypi.org/simple/' || 'https://upload.pypi.org/simple/' }} - test: false - skip_existing: true - distributions: dist/*.tar.gz wheelhouse/*.whl From a3f2c21f4fb455186651510a8bc3a179f1d66acb Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:00:11 +0100 Subject: [PATCH 04/16] update wheels ci --- .github/workflows/wheels.yml | 50 +++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 892cc8e..2357eb6 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -9,6 +9,7 @@ on: release: types: - published + tag: # Trigger on tag push env: # Python 3.12+ is handled using the stable ABI, no need to build later versions @@ -36,6 +37,14 @@ env: CIBW_TEST_REQUIRES: pytest jobs: + check_version_matches_tag: + name: Check version matches tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + build_sdist: name: Build SDist runs-on: ubuntu-latest @@ -58,10 +67,12 @@ jobs: build_wheels: name: Wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' || github.event_name == 'release' strategy: fail-fast: false matrix: os: [ubuntu-latest] + steps: - uses: actions/checkout@v4 @@ -74,11 +85,12 @@ jobs: run: git diff --exit-code shell: bash - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheelhouse-${{strategy.job-index}} - path: wheelhouse/*.whl + - name: upload wheels + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} # unique name for the artifact + path: wheelhouse/*.whl # location of the wheels + upload_to_pypi: name: Upload if release @@ -96,9 +108,35 @@ jobs: - uses: actions/download-artifact@v4 with: - pattern: cibw-* + pattern: cibw-* # download all artifacts path: dist merge-multiple: true - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + + + upload_to_test_pypi: + # runs for distributions or tags + + name: Upload to Test PyPI + needs: [build_wheels, build_sdist] + + if: github.event_name == 'release' || github.event_name == 'workflow_dispatch || github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event_name == 'pull_request' + runs-on: ubuntu-latest + permissions: # Added OIDC permissions + contents: read + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + + steps: + - uses: actions/setup-python@v4 + - uses: actions/download-artifact@v4 + with: + pattern: cibw-* # download all artifacts + + - name: Publish package distributions to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + server: https://test.pypi.org/legacy/ + username: __token__ + password: ${{ secrets.TEST_PYPI_PASSWORD }} \ No newline at end of file From ecd6cab19a054565aa15c7431f51c4827679a329 Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:01:10 +0100 Subject: [PATCH 05/16] changes --- .github/workflows/wheels.yml | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 2357eb6..ce38027 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -6,10 +6,11 @@ on: push: branches: - main + tag: + - '*' release: types: - published - tag: # Trigger on tag push env: # Python 3.12+ is handled using the stable ABI, no need to build later versions diff --git a/pyproject.toml b/pyproject.toml index 9d30a57..1337c18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ build-backend = "scikit_build_core.build" [project] name = "ur_analytic_ik" -version = "0.0.6" +version = "0.0.7-rc" description = "C++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots." readme = "README.md" requires-python = ">=3.8" From dea2d7183edd639e373ff5b6cb3525f30026b0e0 Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:05:29 +0100 Subject: [PATCH 06/16] update --- .github/workflows/wheels.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ce38027..02397ff 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -79,7 +79,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - + - uses: pypa/cibuildwheel@v2.12.0 - name: Verify clean directory @@ -115,7 +115,7 @@ jobs: - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - + upload_to_test_pypi: # runs for distributions or tags @@ -140,4 +140,5 @@ jobs: with: server: https://test.pypi.org/legacy/ username: __token__ - password: ${{ secrets.TEST_PYPI_PASSWORD }} \ No newline at end of file + password: ${{ secrets.TEST_PYPI_PASSWORD }} + skip-existing: false \ No newline at end of file From 9e8b79d32cc3cf58f43fc304d3efcd3f33ba8ccd Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:10:44 +0100 Subject: [PATCH 07/16] try to fix syntax error --- .github/workflows/wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 02397ff..0ca303b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -80,7 +80,8 @@ jobs: with: submodules: true - - uses: pypa/cibuildwheel@v2.12.0 + - name: build wheels + uses: pypa/cibuildwheel@v2.12.0 - name: Verify clean directory run: git diff --exit-code From 980e4e1898fd7c4634af982df8bbbb78f1a2dfbc Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:15:55 +0100 Subject: [PATCH 08/16] try to fix? --- .github/workflows/wheels.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0ca303b..480e94e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -73,13 +73,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - steps: - uses: actions/checkout@v4 with: submodules: true - + - name: build wheels uses: pypa/cibuildwheel@v2.12.0 From e7528493ee76a1419cec5f5854ac5bf1689a1f3e Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:16:53 +0100 Subject: [PATCH 09/16] try to fix? --- .github/workflows/wheels.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 480e94e..86a350e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -86,11 +86,11 @@ jobs: run: git diff --exit-code shell: bash - - name: upload wheels - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} # unique name for the artifact - path: wheelhouse/*.whl # location of the wheels + - name: upload wheels + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} # unique name for the artifact + path: wheelhouse/*.whl # location of the wheels upload_to_pypi: From 103212ea46b6271d9050e4a0b122f5fa878be945 Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:21:05 +0100 Subject: [PATCH 10/16] fix new error --- .github/workflows/wheels.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 86a350e..a444612 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -38,13 +38,6 @@ env: CIBW_TEST_REQUIRES: pytest jobs: - check_version_matches_tag: - name: Check version matches tag - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true build_sdist: name: Build SDist @@ -68,7 +61,7 @@ jobs: build_wheels: name: Wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' || github.event_name == 'release' + if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' || github.event_name == 'release' strategy: fail-fast: false matrix: @@ -123,7 +116,7 @@ jobs: name: Upload to Test PyPI needs: [build_wheels, build_sdist] - if: github.event_name == 'release' || github.event_name == 'workflow_dispatch || github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event_name == 'pull_request' + if: github.event_name == 'release' || github.event_name == 'workflow_dispatch || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'pull_request' runs-on: ubuntu-latest permissions: # Added OIDC permissions contents: read From ffda387f8faaf419af2b72ad9b602eee7a535a86 Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:22:02 +0100 Subject: [PATCH 11/16] fix --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a444612..5fd85e1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -116,7 +116,7 @@ jobs: name: Upload to Test PyPI needs: [build_wheels, build_sdist] - if: github.event_name == 'release' || github.event_name == 'workflow_dispatch || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'pull_request' + if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'pull_request' runs-on: ubuntu-latest permissions: # Added OIDC permissions contents: read From e1873aa86183312e102f2fb787c8aafa155b62fa Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:30:32 +0100 Subject: [PATCH 12/16] test --- .github/workflows/wheels.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5fd85e1..7e02927 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -127,11 +127,12 @@ jobs: - uses: actions/download-artifact@v4 with: pattern: cibw-* # download all artifacts + path: dist + merge-multiple: true - name: Publish package distributions to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - server: https://test.pypi.org/legacy/ - username: __token__ - password: ${{ secrets.TEST_PYPI_PASSWORD }} + repository-ul: https://test.pypi.org/legacy/ + user: tlpss skip-existing: false \ No newline at end of file From 36d2aebad4e555cd5d9324bfc96238839cc228da Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:35:27 +0100 Subject: [PATCH 13/16] test trusted publisher --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7e02927..5464236 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -119,7 +119,7 @@ jobs: if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'pull_request' runs-on: ubuntu-latest permissions: # Added OIDC permissions - contents: read + contents: read id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: From 9bf6e7d2f3a805057d02fcb91cc898535c4d33b0 Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:40:42 +0100 Subject: [PATCH 14/16] fix --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5464236..8a328d8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -133,6 +133,6 @@ jobs: - name: Publish package distributions to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - repository-ul: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ user: tlpss skip-existing: false \ No newline at end of file From e36c5dbe40ce0dee4e96656781e6150a06b9de6e Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 13:50:37 +0100 Subject: [PATCH 15/16] try like this? --- .github/workflows/wheels.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8a328d8..bb06f2e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -134,5 +134,4 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ - user: tlpss skip-existing: false \ No newline at end of file From e7fe9c3b3fd4ad612acc1ce895014b84cc92bb8d Mon Sep 17 00:00:00 2001 From: tlips Date: Mon, 9 Dec 2024 15:24:12 +0100 Subject: [PATCH 16/16] build all wheels --- .github/workflows/wheels.yml | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index bb06f2e..3af1622 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -15,9 +15,10 @@ on: env: # Python 3.12+ is handled using the stable ABI, no need to build later versions CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8, <=3.12" - # Only build for PyPy 3.9 - # CIBW_SKIP: "pp37* pp38*" - CIBW_BUILD: "cp310-manylinux_x86_64" # for testing, build single wheel. + # Only build for PyPy 3.9- + CIBW_SKIP: "pp37* pp38*" + # can be used for testing -> + #CIBW_BUILD: "cp310-manylinux_x86_64" # for testing, build single wheel. # Target 64 bit architectures (x86_64, and arm64 on macOS) CIBW_ARCHS_WINDOWS: auto64 @@ -29,8 +30,7 @@ env: CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 # Necessary to see build output from the actual compilation CIBW_BUILD_VERBOSITY: 1 - # Temporary: use pre-release Python 3.12 for stable API builds - CIBW_PRERELEASE_PYTHONS: True + # GitHub Actions doesn't have macOS/arm64 runners, skip test on this platform CIBW_TEST_SKIP: "*-macosx_arm64" # Run pytest to ensure that the package was correctly built diff --git a/pyproject.toml b/pyproject.toml index 1337c18..f09a559 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ build-backend = "scikit_build_core.build" [project] name = "ur_analytic_ik" -version = "0.0.7-rc" +version = "0.0.7-rc2" description = "C++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots." readme = "README.md" requires-python = ">=3.8"