Skip to content

Commit 741ffd6

Browse files
authored
Detect prerelease in publish-release.yml
1 parent 21289d7 commit 741ffd6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/publish-release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,21 @@ jobs:
148148
149149
- name: Build package
150150
run: python -m build --sdist --wheel
151-
151+
152+
- name: Detect Pre-release
153+
shell: bash
154+
run: |
155+
if echo "${{ github.ref_name }}" | grep -q '^[0-9][0-9]\.[0-9][0-9]\.[A-Za-z]'; then
156+
echo "PRERELEASE=true" >> $GITHUB_ENV
157+
else
158+
echo "PRERELEASE=false" >> $GITHUB_ENV
159+
fi
160+
echo PRERELEASE=${{ env.PRERELEASE }}
161+
152162
- name: Release package
153163
uses: softprops/action-gh-release@v2
154164
with:
165+
prerelease: ${{ env.PRERELEASE }}
155166
files: ./dist/spm_python*.whl
156167

157168
- name: Publish package

0 commit comments

Comments
 (0)