Skip to content

Commit 488e35b

Browse files
authored
Update wheel workflow (#187)
1 parent 056491b commit 488e35b

1 file changed

Lines changed: 51 additions & 1 deletion

File tree

.github/workflows/wheel.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python: ['3.7', '3.8', '3.9', '3.10']
34+
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
3535

3636
defaults:
3737
run:
@@ -76,3 +76,53 @@ jobs:
7676
name: dftd4-python-${{ matrix.python }}
7777
path: ./*.whl
7878
retention-days: 5
79+
80+
release:
81+
needs:
82+
- sdist
83+
- manylinux
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Download artifacts
87+
uses: actions/download-artifact@v2
88+
with:
89+
path: ${{ github.workspace }} # This will download all files
90+
91+
- name: Create SHA256 checksums
92+
run: |
93+
set -ex
94+
for output in dftd4*/dftd4*; do
95+
pushd $(dirname "$output")
96+
sha256sum $(basename "$output") | tee $(basename "$output").sha256
97+
popd
98+
done
99+
100+
- name: Copy release artifacts
101+
run: |
102+
mkdir dist/
103+
cp -v dftd4*/dftd4*.whl dftd4*/dftd4*.tar.gz dist/
104+
105+
- name: Publish to Test PyPI
106+
if: ${{ github.event_name == 'release' }}
107+
uses: pypa/gh-action-pypi-publish@release/v1
108+
with:
109+
user: __token__
110+
password: ${{ secrets.TEST_PYPI_TOKEN }}
111+
repository_url: https://test.pypi.org/legacy/
112+
113+
- name: Upload assets
114+
uses: svenstaro/upload-release-action@v2
115+
if: ${{ github.event_name == 'release' }}
116+
with:
117+
repo_token: ${{ secrets.GITHUB_TOKEN }}
118+
file: dftd4*/dftd4*
119+
file_glob: true
120+
tag: ${{ github.ref }}
121+
overwrite: true
122+
123+
- name: Publish to PyPI
124+
if: ${{ github.event_name == 'release' }}
125+
uses: pypa/gh-action-pypi-publish@release/v1
126+
with:
127+
user: __token__
128+
password: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)