Skip to content

Commit

Permalink
add prerelease support in CD
Browse files Browse the repository at this point in the history
  • Loading branch information
mjurbanski-reef committed Mar 21, 2024
1 parent 68d6387 commit 7067616
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
B2_PYPI_PASSWORD: ${{ secrets.B2_PYPI_PASSWORD }}
runs-on: ubuntu-latest
steps:
- name: Determine if pre-release
id: prerelease_check
run: |
export IS_PRERELEASE=$([[ ${{ github.ref }} =~ [^0-9]$ ]] && echo true || echo false)
echo "prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -40,11 +45,11 @@ jobs:
name: ${{ steps.build.outputs.version }}
body: ${{ steps.read-changelog.outputs.changes }}
draft: ${{ env.ACTIONS_STEP_DEBUG == 'true' }}
prerelease: false
prerelease: ${{ steps.prerelease_check.outputs.prerelease }}
files: ${{ steps.build.outputs.asset_path }}
- name: Upload the distribution to PyPI
if: ${{ env.B2_PYPI_PASSWORD != '' }}
if: ${{ env.B2_PYPI_PASSWORD != '' && steps.prerelease_check.outputs.prerelease == 'false' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ env.B2_PYPI_PASSWORD }}
password: ${{ secrets.B2_PYPI_PASSWORD }}

0 comments on commit 7067616

Please sign in to comment.