Skip to content

Commit

Permalink
chore: enable manual trigger for release candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
cuinixam authored and xxthunder committed Jan 13, 2025
1 parent bc959fc commit b973d48
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
branches: [develop]

workflow_dispatch:
inputs:
target_branch:
description: 'The branch to release from'
required: true
default: 'develop'

concurrency:
group: ${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -68,21 +73,24 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref_name }}
ref: ${{ github.event.inputs.target_branch || github.head_ref || github.ref_name }}

# Do a dry run of release
- name: Test release
uses: python-semantic-release/[email protected]
if: github.ref_name != 'develop'
with:
root_options: --noop
- name: Determine Release Type
id: determine_release
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "release_options=--prerelease" >> $GITHUB_ENV
elif [ "${{ github.ref_name }}" = "develop" ]; then
echo "release_options=" >> $GITHUB_ENV
else
echo "release_options=--noop" >> $GITHUB_ENV
fi
# On main branch: actual release + upload to PyPI & GitHub
- name: Release
uses: python-semantic-release/[email protected]
id: release
if: github.ref_name == 'develop'
with:
root_options: ${{ env.release_options }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish package distributions to PyPI
Expand Down

0 comments on commit b973d48

Please sign in to comment.