Skip to content

Commit fbb34ea

Browse files
committed
Add GitHub Releases action to deploy workflow
While we don't really need to upload release files to GitHub (as they are uploaded to PyPI), creating releases does provide a mechanism to notify users that a new release is available. As GitHub will automaticaly create files from the repo when none are provided, we upload the official distribution files instead. Fixes #1365.
1 parent 6662053 commit fbb34ea

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,25 @@ jobs:
1414
- name: Setup Python
1515
uses: actions/setup-python@v1
1616
with:
17-
python-version: 3.7
17+
python-version: 3.11
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip setuptools wheel build
2121
- name: Build
2222
run: |
2323
python -m build
24-
- name: Publish
24+
- name: Publish to PyPI
2525
if: success()
2626
uses: pypa/gh-action-pypi-publish@v1.1.0
2727
with:
2828
user: __token__
2929
password: ${{ secrets.PYPI_PASSWORD }}
30+
- name: Release to GitHub
31+
if: success() && startsWith(github.ref, 'refs/tags/')
32+
uses: fnkr/github-action-ghr@v1
33+
env:
34+
GHR_PATH: dist/
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3036

3137
ghpages:
3238
runs-on: ubuntu-latest
@@ -35,15 +41,15 @@ jobs:
3541
- name: Setup Python
3642
uses: actions/setup-python@v1
3743
with:
38-
python-version: 3.7
44+
python-version: 3.11
3945
- name: Install dependencies
4046
run: |
4147
python -m pip install --upgrade pip setuptools
4248
python -m pip install .[docs]
4349
- name: Build
4450
run: |
4551
python -m mkdocs build --clean --verbose
46-
- name: Publish
52+
- name: Publish to GitHub Pages
4753
if: success()
4854
uses: peaceiris/actions-gh-pages@v3
4955
with:

0 commit comments

Comments
 (0)