-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding action for publishing to PyPi
-[ADDED] GitHub action to publish python package to PyPi -[CHANGED] Formatting with black (PEP 8)
- Loading branch information
1 parent
641c330
commit 335a200
Showing
5 changed files
with
165 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Publish python package to PyPi | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-python-package: | ||
name: Build distribution packages | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- name: Install dependencies and build distribution packages | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
python setup.py sdist bdist_wheel | ||
twine check dist/* | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: Publish Python distribution package to PyPI | ||
if: ${{ github.repository == 'quantorconsulting/mkdocs_build_plantuml' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} | ||
needs: | ||
- build-python-package | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pipy | ||
url: https://pypi.org/p/mkdocs-build-plantuml-plugin | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution packages to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,6 @@ ENV/ | |
|
||
# Vs Code | ||
.vscode/ | ||
|
||
# Python virtual environments | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.