-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from Vik-it99/C2DEVEL-16327
C2DEVEL-16327: build and publish to PyPi
- Loading branch information
Showing
1 changed file
with
55 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,55 @@ | ||
name: Publish python distribution to PyPI | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install setuptools wheel twine | ||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Upload distributions | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "distributions-for-${{ github.event.release.tag_name }}" | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: Publish to PyPI | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download distributions | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: "distributions-for-${{ github.event.release.tag_name }}" | ||
path: dist/ | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
username: __token__ | ||
repository-url: https://pypi.org/legacy/ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|