Skip to content

Commit 3c7fc99

Browse files
committed
BLD: check tag
1 parent 6a48687 commit 3c7fc99

File tree

1 file changed

+40
-13
lines changed

1 file changed

+40
-13
lines changed

.github/workflows/wheels.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ jobs:
4949
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
5050
buildplat:
5151
- [ubuntu-22.04, manylinux_x86_64, ""]
52-
- [ubuntu-22.04, musllinux_x86_64, ""]
53-
- [ubuntu-22.04-arm, manylinux_aarch64, ""]
54-
- [ubuntu-22.04-arm, musllinux_aarch64, ""]
55-
- [macos-13, macosx_x86_64, openblas]
56-
57-
# targeting macos >= 14. Could probably build on macos-14, but it would be a cross-compile
58-
- [macos-13, macosx_x86_64, accelerate]
59-
- [macos-14, macosx_arm64, openblas]
60-
- [macos-14, macosx_arm64, accelerate]
61-
- [windows-2022, win_amd64, ""]
62-
- [windows-2022, win32, ""]
63-
- [windows-11-arm, win_arm64, ""]
52+
# - [ubuntu-22.04, musllinux_x86_64, ""]
53+
# - [ubuntu-22.04-arm, manylinux_aarch64, ""]
54+
# - [ubuntu-22.04-arm, musllinux_aarch64, ""]
55+
# - [macos-13, macosx_x86_64, openblas]
56+
#
57+
# # targeting macos >= 14. Could probably build on macos-14, but it would be a cross-compile
58+
# - [macos-13, macosx_x86_64, accelerate]
59+
# - [macos-14, macosx_arm64, openblas]
60+
# - [macos-14, macosx_arm64, accelerate]
61+
# - [windows-2022, win_amd64, ""]
62+
# - [windows-2022, win32, ""]
63+
# - [windows-11-arm, win_arm64, ""]
6464
python: ["cp311", "cp312", "cp313", "cp313t", "cp314", "cp314t", "pp311"]
6565
exclude:
6666
# Don't build PyPy 32-bit windows
@@ -239,10 +239,37 @@ jobs:
239239
print-hash: true
240240
attestations: true
241241

242+
check_version:
243+
name: Ensure commit is tag before upload to PyPi
244+
245+
#if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
246+
needs: [build_wheels, build_sdist]
247+
runs-on: ubuntu-latest
248+
steps:
249+
- name: Checkout numpy
250+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
251+
with:
252+
repository: numpy/numpy
253+
ref: ${{ env.SOURCE_REF_TO_BUILD }}
254+
path: numpy-src
255+
submodules: true
256+
persist-credentials: false
257+
258+
- name: Examine git commit
259+
run: |
260+
pwd
261+
hash=$(git describe HEAD)
262+
if [[ $hash == *"-"*"-"* ]]; then
263+
echo "Build version is not a tag"
264+
exit 1
265+
else
266+
echo "Build version is a tag"
267+
fi;
268+
242269
pypi-publish:
243270
name: Publish release to PyPI
244271
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
245-
needs: [build_wheels, build_sdist]
272+
needs: [check_version]
246273
runs-on: ubuntu-latest
247274
environment:
248275
name: pypi

0 commit comments

Comments
 (0)