@@ -72,31 +72,45 @@ jobs:
7272 make test
7373
7474 deploy :
75+ # See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1?tab=readme-ov-file#usage
7576 needs :
76- # - codechecks # skip for now
77- - test
77+ # - cqa
78+ - test
7879 runs-on : ubuntu-latest
7980
80- steps :
81- - uses : actions/checkout@v3
82-
83- - name : Set up Python
84- uses : actions/setup-python@v4
85- with :
86- python-version : " 3.10"
87- cache : pip
88- cache-dependency-path : " **/setup.cfg"
81+ environment :
82+ name : pypi
83+ url : https://pypi.org/p/biocommons.seqrepo
84+ permissions :
85+ id-token : write # mandatory for trusted publishing
8986
90- - name : Install dependencies
91- run : |
92- pip install --upgrade pip
93- pip install build pytest pytest-cov twine
94- - name : Build package
95- run : python -m build
96-
97- - name : Publish package
98- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
99- uses : pypa/gh-action-pypi-publish@release/v1
100- with :
101- user : __token__
102- password : ${{ secrets.PYPI_API_TOKEN }}
87+ steps :
88+ - name : Environment
89+ run : |
90+ echo "::group::Environment info"
91+ echo github.event_name = ${{ github.event_name }}
92+ echo refs = ${{ github.ref }}
93+ echo tags = ${{ startsWith(github.ref, 'refs/tags') }}
94+ echo "::endgroup::"
95+
96+ - uses : actions/checkout@v3
97+
98+ - name : Set up Python
99+ uses : actions/setup-python@v4
100+ with :
101+ python-version : " 3.10"
102+ cache : pip
103+ cache-dependency-path : ' **/setup.cfg'
104+
105+ - name : Install dependencies
106+ run : |
107+ python -m pip install --upgrade pip
108+ pip install build twine
109+
110+ - name : Build package
111+ run : python -m build
112+
113+ - name : Upload release to PyPI
114+ # Depends on trusted publishing configuration at pypi
115+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
116+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments