-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(build.yml): add GitHub Actions workflow for Python package bui…
…ld and publish * fix(setup.py): bump version from 0.3.1 to 0.4.0
- Loading branch information
1 parent
801ee4b
commit f873c62
Showing
2 changed files
with
37 additions
and
1 deletion.
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,36 @@ | ||
name: Python Package Build and Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Only run workflow for pushes to main branch | ||
release: | ||
types: [created] # Run workflow when a new release is created | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 # Checkout the repository content to GitHub Actions runner | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' # Specify the Python version | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install setuptools wheel twine | ||
- name: Build source and wheel distribution | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Publish the distribution to PyPI | ||
if: github.event_name == 'release' && github.event.action == 'created' | ||
run: twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
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