Skip to content

Commit e4c4911

Browse files
committed
build sdist flag added
1 parent d1bbd82 commit e4c4911

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,18 @@ jobs:
7070
- name: Describe Tag & Branch Name
7171
id: build_names
7272
run: |
73-
# Only set TAG_NAME if the event is a tag push
74-
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
75-
echo TAG_NAME=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
76-
else
73+
echo TAG_NAME=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
74+
75+
- name: Check if event is a tag push
76+
id: check_tag
77+
run: |
78+
if [[ "${GITHUB_REF}" != refs/tags/* ]]; then
7779
echo "This event is not a tag push. Skipping sdist build."
78-
exit 1 # Exit if not a tag
80+
echo "skip_build=true" >> $GITHUB_ENV # Set an environment variable to control flow
7981
fi
8082
8183
- name: Build sdist
84+
if: env.skip_build != 'true'
8285
run: |
8386
echo $TAG_NAME
8487
cd python
@@ -94,6 +97,7 @@ jobs:
9497
TAG_NAME: ${{ steps.build_names.outputs.TAG_NAME }}
9598

9699
- uses: actions/upload-artifact@v4
100+
if: env.skip_build != 'true'
97101
with:
98102
path: python/dist/*.tar.gz
99103
overwrite: true

0 commit comments

Comments
 (0)