-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating GH Actions Workflow to Publish @ PyPI
1 parent
0ed5340
commit 921aa74
Showing
1 changed file
with
45 additions
and
0 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,45 @@ | ||
name: Publish `Directory-Tree` to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
publish-package: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# Checkout the Repository | ||
- name: Check out the Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
|
||
# Set up `Python 3.9` | ||
- name: Set up Python 3.9 for Actions | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.9' | ||
|
||
# Upgrade `pip` and Install Build Dependencies | ||
- name: Install Required Dependencies for Build | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
# Build the Python Package | ||
- name: Build the Python Package | ||
run: python -m build | ||
|
||
# Publish the Package to PyPI | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|