Skip to content

Commit 2d1b0f5

Browse files
committed
update
1 parent 3bffd59 commit 2d1b0f5

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

‎.github/workflows/releases.yml‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,26 @@ concurrency:
2121

2222
jobs:
2323

24+
validate_tag:
25+
if: github.event_name == 'workflow_dispatch'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Validate tag format
29+
run: |
30+
if [[ ! "${{ inputs.tag }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([a-z]+[0-9]*)?$ ]]; then
31+
echo "::error::Invalid tag format '${{ inputs.tag }}'. Expected format: v1.2.3, v1.2.3a1, v1.2.3rc1"
32+
exit 1
33+
fi
34+
- name: Verify tag exists
35+
run: |
36+
git ls-remote --tags "${{ github.server_url }}/${{ github.repository }}" "${{ inputs.tag }}" | grep -q "${{ inputs.tag }}" || {
37+
echo "::error::Tag '${{ inputs.tag }}' does not exist in the repository"
38+
exit 1
39+
}
40+
2441
build_artifacts:
42+
needs: [validate_tag]
43+
if: always() && (needs.validate_tag.result == 'success' || needs.validate_tag.result == 'skipped')
2544
name: Build wheel on ubuntu-latest
2645
runs-on: ubuntu-latest
2746
strategy:
@@ -69,7 +88,7 @@ jobs:
6988
runs-on: ubuntu-latest
7089
if: >-
7190
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v'))
72-
|| github.event_name == 'workflow_dispatch'
91+
|| (github.event_name == 'workflow_dispatch' && startsWith(inputs.tag, 'v'))
7392
environment:
7493
name: releases
7594
url: https://pypi.org/p/zarr

0 commit comments

Comments
 (0)