Skip to content

Commit b41dcbf

Browse files
authored
Skipping the version update on empty tag (#264)
1 parent 0b7528e commit b41dcbf

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ jobs:
4242
run: |
4343
TAG=${{ github.event.inputs.tag }}
4444
VERSION=${TAG#v}
45-
sed -i '/^version /s/=.*$/= "'"$VERSION"'"/' hf_xet/Cargo.toml
45+
if [ -n "$VERSION" ]; then
46+
sed -i '/^version /s/=.*$/= "'"$VERSION"'"/' hf_xet/Cargo.toml
47+
fi
4648
- name: Build wheels
4749
uses: PyO3/maturin-action@v1
4850
with:
@@ -86,7 +88,9 @@ jobs:
8688
run: |
8789
TAG=${{ github.event.inputs.tag }}
8890
VERSION=${TAG#v}
89-
sed -i '/^version /s/=.*$/= "'"$VERSION"'"/' hf_xet/Cargo.toml
91+
if [ -n "$VERSION" ]; then
92+
sed -i '/^version /s/=.*$/= "'"$VERSION"'"/' hf_xet/Cargo.toml
93+
fi
9094
- name: Build wheels
9195
uses: PyO3/maturin-action@v1
9296
with:
@@ -119,7 +123,9 @@ jobs:
119123
run: |
120124
TAG=${{ github.event.inputs.tag }}
121125
VERSION=${TAG#v}
122-
sed -i '/^version /s/=.*$/= "'"$VERSION"'"/' hf_xet/Cargo.toml
126+
if [ -n "$VERSION" ]; then
127+
sed -i '/^version /s/=.*$/= "'"$VERSION"'"/' hf_xet/Cargo.toml
128+
fi
123129
- name: Build wheels
124130
uses: PyO3/maturin-action@v1
125131
with:
@@ -151,7 +157,9 @@ jobs:
151157
run: |
152158
TAG=${{ github.event.inputs.tag }}
153159
VERSION=${TAG#v}
154-
sed -i '' '/^version /s/=.*$/= "'"$VERSION"'"/' hf_xet/Cargo.toml
160+
if [ -n "$VERSION" ]; then
161+
sed -i '' '/^version /s/=.*$/= "'"$VERSION"'"/' hf_xet/Cargo.toml
162+
fi
155163
- name: Build wheels
156164
uses: PyO3/maturin-action@v1
157165
with:

0 commit comments

Comments
 (0)