Skip to content
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
25 changes: 25 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
tags:
- "rel/*.*.*"
- "rel/*.*.*.*"
workflow_dispatch:
inputs:
tag_name:
description: 'Release Tag name for creating Github Release'
required: false
type: string

jobs:
build-n-publish:
Expand Down Expand Up @@ -43,10 +49,29 @@ jobs:
password: ${{ secrets.PYPI_API_TOKEN }} # This token should be created in Settings > Secrets > Actions
# repository_url: https://test.pypi.org/legacy/ # Use this for testing to upload the distribution to test.pypi

- name: Determine tag
id: tag
run: |
TAG_NAME=""
if [[ "${{ github.event.inputs.tag_name }}" != "" ]]; then
TAG_NAME="${{ github.event.inputs.tag_name }}"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG_NAME="${GITHUB_REF#refs/tags/}"
fi

if [[ -z "$TAG_NAME" ]]; then
echo "No valid tag provided. Skipping release."
exit 0
else
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
fi

- name: Create/Update GitHub Release
id: create_update_release
if: env.TAG_NAME != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG_NAME }}
allowUpdates: true
omitNameDuringUpdate: true
makeLatest: true
Expand Down
Loading