From f57522ca509f5c2fc1b08c4b79c17bfc9edff226 Mon Sep 17 00:00:00 2001 From: Felix Kaschura Date: Thu, 7 Mar 2024 15:59:30 +0100 Subject: [PATCH] Change tag name to semantic versioning and add automatic releases to publish workflow --- .github/workflows/publish.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27d1e99..8b306a9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -56,6 +56,7 @@ jobs: run: | twine upload --repository-url ${{ vars.PYPI_API_ENDPOINT }} dist/* - name: Tag commit + id: tag_commit if: ${{ (github.ref_name == 'main') || ((inputs.targetenv || 'testpypi') == 'pypi') }} run: | pip install --no-index --no-deps --find-links=dist/ pysweepme @@ -64,8 +65,18 @@ jobs: { Throw "Inspected version $PysweepmeVersion could not be found in any wheels in the dist folder." } - $TagName = "Release-${PysweepmeVersion}_(${{ inputs.targetenv || 'testpypi' }})" + $TagName = "v${PysweepmeVersion}" git tag $TagName git push origin $TagName + "PysweepmeVersion=${PysweepmeVersion}" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + "TagName=${TagName}" | Out-File -FilePath $env:GITHUB_OUTPUT -Append shell: pwsh - + - name: Create github release + if: ${{ (github.ref_name == 'main') || ((inputs.targetenv || 'testpypi') == 'pypi') }} + uses: ncipollo/release-action@v1 + with: + artifacts: "dist/*" + generateReleaseNotes: true + makeLatest: true + name: ${{ format('pysweepme {0}', steps.tag_commit.outputs.PysweepmeVersion) }} + tag: ${{ steps.tag_commit.outputs.TagName }}