Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix publishing workflow issues #1188

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ name: Publish Python Package
on:
workflow_dispatch:
inputs:
publish:
publish_release:
description: 'Create Production Release'
required: true
type: boolean
skip_test_pypi:
description: "Skip publishing to test PyPI"
required: false
type: boolean
default: "false"

jobs:
publish:
Expand All @@ -25,7 +30,7 @@ jobs:
fetch-depth: 0

- name: Get Next Version
if: ${{ github.event.inputs.publish }}
if: ${{ inputs.publish_release }}
id: semver
uses: ietf-tools/semver-action@v1
with:
Expand All @@ -34,15 +39,15 @@ jobs:
branch: main

- name: Set Next Version Env Var
if: ${{ github.event.inputs.publish }}
if: ${{ inputs.publish_release }}
env:
NEXT_VERSION: ${{ steps.semver.outputs.next }}
run: |
echo "NEXT_VERSION=$next" >> $GITHUB_ENV

- name: Create Draft Release
uses: ncipollo/release-action@v1
if: ${{ github.event.inputs.publish }}
if: ${{ inputs.publish_release }}
with:
prerelease: true
draft: false
Expand Down Expand Up @@ -124,17 +129,20 @@ jobs:
makeLatest: true

- name: Publish to Test PyPI
if: ${{ !inputs.skip_test_pypi }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish to PyPI
if: env.SHOULD_DEPLOY == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: false

build-base:
runs-on: ubuntu-latest
if: github.event.inputs.publish
if: ${{ inputs.publish_release }}
needs: [publish]
permissions:
contents: read
Expand Down
Loading