Skip to content

Commit

Permalink
test creating releases
Browse files Browse the repository at this point in the history
  • Loading branch information
fk3 committed Mar 7, 2024
1 parent e67d878 commit 8534877
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,28 @@ jobs:
run: |
twine upload --repository-url ${{ vars.PYPI_API_ENDPOINT }} dist/*
- name: Tag commit
if: ${{ (github.ref_name == 'main') || ((inputs.targetenv || 'testpypi') == 'pypi') }}
id: tag_commit
if: ${{ (github.ref_name == 'testmain') || ((inputs.targetenv || 'testpypi') == 'testpypi') }}
run: |
pip install --no-index --no-deps --find-links=dist/ pysweepme
$PysweepmeVersion = python -c "import importlib.metadata; print(importlib.metadata.version('pysweepme'))"
if ( -not (Get-ChildItem -Path dist -Filter "*${PysweepmeVersion}*.whl"))
{
Throw "Inspected version $PysweepmeVersion could not be found in any wheels in the dist folder."
}
$TagName = "v${PysweepmeVersion}"
$TagName = "t${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 == 'testmain') || ((inputs.targetenv || 'testpypi') == 'testpypi') }}
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
draft: true
generateReleaseNotes: true
makeLatest: true
name: ${{ format('pysweepme {0}', steps.tag_commit.outputs.PysweepmeVersion) }}
tag: ${{ steps.tag_commit.outputs.TagName }}

0 comments on commit 8534877

Please sign in to comment.