Skip to content

Commit

Permalink
Publish dev version of package in PRs (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored Nov 5, 2024
1 parent 5ec97e3 commit f6f51c9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/python_cd.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Python CD

on:
pull_request:
release:
types: [ published ]

jobs:
publish-pypi-package:
if: github.event_name == 'release'
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -21,3 +23,21 @@ jobs:
- name: Build and Publish
run: poetry publish -p ${{ secrets.PYPI_TOKEN }} -u "__token__" --build
shell: bash

publish-dev-package:
if: contains(github.event.pull_request.body, 'deploy please') && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/python_prepare
- name: Set Development Version
run: |
current_version=$(poetry version -s)
poetry version "${current_version}.dev${{ github.run_number }}"
shell: bash
- name: Build and Publish Development Package
run: poetry publish -p ${{ secrets.PYPI_TOKEN }} -u "__token__" --build
shell: bash

0 comments on commit f6f51c9

Please sign in to comment.