Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,40 @@ jobs:
print-hash: true
attestations: true

check_version:
name: Ensure commit is tag before upload to PyPi

if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- name: Checkout numpy
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: numpy/numpy
ref: ${{ env.SOURCE_REF_TO_BUILD }}
path: numpy-src
fetch-depth: 0
fetch-tags: true
submodules: false
persist-credentials: false

- name: Examine git commit
run: |
cd numpy-src
hash=$(git describe HEAD)
echo $hash
if [[ $hash == *"-"*"-"* ]]; then
echo "SOURCE_REF_TO_BUILD is not a tag"
exit 1
else
echo "SOURCE_REF_TO_BUILD is a tag"
fi;

pypi-publish:
name: Publish release to PyPI
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
needs: [build_wheels, build_sdist]
needs: [check_version]
runs-on: ubuntu-latest
environment:
name: pypi
Expand Down