Skip to content

Commit

Permalink
Add GitHub Releases action to deploy workflow
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
waylan committed Aug 7, 2023
1 parent 6662053 commit fbb34ea
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,25 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel build
- name: Build
run: |
python -m build
- name: Publish
- name: Publish to PyPI
if: success()
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
- name: Release to GitHub
if: success() && startsWith(github.ref, 'refs/tags/')
uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: dist/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ghpages:
runs-on: ubuntu-latest
Expand All @@ -35,15 +41,15 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .[docs]
- name: Build
run: |
python -m mkdocs build --clean --verbose
- name: Publish
- name: Publish to GitHub Pages
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down

0 comments on commit fbb34ea

Please sign in to comment.