From 4aa7a952b726012f13d42b6b7bdf4f36fe73b9c3 Mon Sep 17 00:00:00 2001 From: Elijas <4084885+Elijas@users.noreply.github.com> Date: Tue, 26 Sep 2023 02:35:25 +0300 Subject: [PATCH] ci(release): allow for manual release --- .github/workflows/release.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f81a3e4..a77025f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,14 @@ jobs: - name: Build package run: poetry build - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PUBLIC_PYPI_API_TOKEN }} + run: | + # Use the build number to create a local version identifier + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + BUILD_NUMBER=${{ github.event.inputs.build_number }} + POETRY_VERSION=$(poetry version | awk '{print $2}') + NEW_VERSION="${POETRY_VERSION}+build${BUILD_NUMBER}" + poetry version "${NEW_VERSION}" + fi + poetry build + poetry publish --username __token__ --password ${{ secrets.PUBLIC_PYPI_API_TOKEN }} + \ No newline at end of file