Skip to content

Commit

Permalink
Fix and polish the release workflow (#201)
Browse files Browse the repository at this point in the history
* Fix environment name

* Add tokens for PyPI release

* Test PyPI release for all the branches

* Fix valid classifier in matadata in pyproject.toml
  • Loading branch information
FanwangM authored Oct 1, 2024
1 parent 83809c2 commit f874dac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
name: PyPI-Release
url: https://pypi.org/project/${{ env.PYPI_NAME }}
permissions:
id-token: write
Expand All @@ -66,6 +66,9 @@ jobs:
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

github-release:
name: Sign the Python distribution with Sigstore and upload them to GitHub Release
Expand Down Expand Up @@ -107,13 +110,13 @@ jobs:
publish-to-testpypi:
name: Publish Python distribution to TestPyPI
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'theochem' }}
# if: ${{ github.ref == 'refs/heads/master' && github.repository_owner == 'theochem' }}
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
name: TestPyPI
url: https://test.pypi.org/project/${{ env.PYPI_NAME }}

permissions:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readme = "README.md"
license = {text = "GPL-3.0-or-later"}
requires-python = ">=3.9"
classifiers = [
'Development Status :: 0 - Released',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: POSIX :: Linux',
Expand Down

0 comments on commit f874dac

Please sign in to comment.