Skip to content

Commit

Permalink
Fix and modernize release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed May 28, 2023
1 parent 7ee66f7 commit ad702b6
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,33 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade -r requirements.txt
python -m pip install --upgrade twine
python -m pip install --upgrade build
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- uses: actions/upload-artifact@v3
with:
name: python_wheel
path: dist/*
if-no-files-found: error

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create/update release on GitHub
uses: ncipollo/[email protected]
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
allowUpdates: true
artifacts: "dist/*"
generateReleaseNotes: true
omitNameDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
fail_on_unmatched_files: true
files: dist/*
generate_release_notes: true

0 comments on commit ad702b6

Please sign in to comment.