From 29c44a666ccf5778d8950bdca7274c5e0bef321d Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Wed, 23 Apr 2025 23:16:49 +0200 Subject: [PATCH 1/6] Use unique names for different artifacts; fix download before uploading to PyPI --- .github/workflows/build_release.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index bc16c69..7cdbb41 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -25,6 +25,7 @@ jobs: - uses: actions/upload-artifact@v4 with: + name: tarball path: dist/*.tar.gz build_wheels: @@ -46,10 +47,8 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: + name: wheels-${{ matrix.os }} path: wheelhouse/*.whl - # Temporary allow overwrite until we use setuptools_scm to - # generate unique version numbers on every push - overwrite: true upload_pypi: name: Upload release to PyPI @@ -61,7 +60,7 @@ jobs: # For testing, use TestPyPI # url: https://test.pypi.org/p/python-casacore permissions: - id-token: write + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing # 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: @@ -69,12 +68,9 @@ jobs: steps: - 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 - path: dist - - - uses: pypa/gh-action-pypi-publish@v1.8.11 + path: dist # put artifacts where next action expects them to be + merge-multiple: true + - uses: pypa/gh-action-pypi-publish@release/v1 with: # For testing, use TestPyPI # repository-url: https://test.pypi.org/legacy/ From 9ec8d614a22ec5077138d6fc0fbb20bd98379d2c Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Wed, 23 Apr 2025 23:30:19 +0200 Subject: [PATCH 2/6] Always publish (to TestPyPI); only build for Python 3.13 --- .github/workflows/build_release.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 7cdbb41..4aef7fe 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -62,7 +62,7 @@ jobs: permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing # Upload to PyPI on every tag starting with 'v' - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/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' steps: @@ -73,6 +73,6 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: # For testing, use TestPyPI - # repository-url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ skip-existing: true verbose: true diff --git a/pyproject.toml b/pyproject.toml index 66c89ff..47ecc28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ Homepage = "https://github.com/casacore/python-casacore" ######################### [tool.cibuildwheel] -build = "cp3{8,9,10,11,12,13}-*_x86_64" +build = "cp313-*_x86_64" build-verbosity = 1 environment = """ \ CXXFLAGS="-I/usr/include/cfitsio" \ From 4fc943668c374ca24cf831e3eab4e17b1e387c60 Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Thu, 24 Apr 2025 12:07:50 +0200 Subject: [PATCH 3/6] Only build wheel for Python 3.12 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 47ecc28..9f345f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ Homepage = "https://github.com/casacore/python-casacore" ######################### [tool.cibuildwheel] -build = "cp313-*_x86_64" +build = "cp312-*_x86_64" build-verbosity = 1 environment = """ \ CXXFLAGS="-I/usr/include/cfitsio" \ From 2c4139489d599baaa1619111a65793bfc742bf18 Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Thu, 24 Apr 2025 17:09:54 +0200 Subject: [PATCH 4/6] Fix bug in build_release workflow (#284) * Make sure we publish on TestPyPI * Remove Ubuntu 20.04 from workflow * Build wheels for all Python versions * Use latest version of MacOS * Revert to publishing on PyPI * Revert "Revert to publishing on PyPI" This reverts commit bd1e0a27f6d6ce5bd067e5b6c5e9aadfbcc50a85. * Revert "Build wheels for all Python versions" This reverts commit 700e71233321119022dbde7a36d6372a5af672ac. * Run Linux workflow alsowhen tags are created * Switch to MacOS-13 to force Intel-based build * Reapply "Revert to publishing on PyPI" This reverts commit 64c39a68dd178fd7865e8be1af9d17740a4c9715. --- .github/workflows/build_release.yml | 4 ++-- .github/workflows/linux.yml | 3 ++- .github/workflows/osx.yml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 4aef7fe..7cdbb41 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -62,7 +62,7 @@ jobs: permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing # Upload to PyPI on every tag starting with 'v' -# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/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' steps: @@ -73,6 +73,6 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: # For testing, use TestPyPI - repository-url: https://test.pypi.org/legacy/ + # repository-url: https://test.pypi.org/legacy/ skip-existing: true verbose: true diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 748b348..7d164da 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -3,6 +3,7 @@ name: Linux on: push: branches: [ master ] + tags: [ "*" ] pull_request: branches: [ master ] @@ -11,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + os: [ubuntu-22.04, ubuntu-24.04] dist: - py3_casacore_master steps: diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index db588cc..df43053 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -9,7 +9,7 @@ on: jobs: osx: - runs-on: macos-11 + runs-on: macos-13 continue-on-error: true steps: From f0d7229312e83ab1ba73ffca18d26211337ffd62 Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Thu, 24 Apr 2025 17:13:30 +0200 Subject: [PATCH 5/6] Build wheels for all Python versions --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9f345f8..66c89ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ Homepage = "https://github.com/casacore/python-casacore" ######################### [tool.cibuildwheel] -build = "cp312-*_x86_64" +build = "cp3{8,9,10,11,12,13}-*_x86_64" build-verbosity = 1 environment = """ \ CXXFLAGS="-I/usr/include/cfitsio" \ From f004a85cfb0927039eb4d9b47af34f5f59e11e41 Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Thu, 24 Apr 2025 22:14:53 +0200 Subject: [PATCH 6/6] Bump version of cibuildwheel to use --- .github/workflows/build_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 7cdbb41..a0307d7 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -42,7 +42,7 @@ jobs: fetch-depth: 0 - name: Build wheels - uses: pypa/cibuildwheel@v2.16 + uses: pypa/cibuildwheel@v2.23 - name: Upload wheels uses: actions/upload-artifact@v4