-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08330bc
commit b8925fd
Showing
1 changed file
with
23 additions
and
25 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 |
---|---|---|
@@ -1,37 +1,35 @@ | ||
name: Publish Python 🐍 distributions 📦 to PyPI | ||
name: Build and Upload to PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Adjust to your main branch name | ||
|
||
on: push | ||
jobs: | ||
build-and-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4.1.1 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
# Setup Python (faster than using Python container) | ||
- name: Setup Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
python-version: 3.x # Specify the Python version you're using | ||
|
||
- name: Install pipenv | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pipenv wheel | ||
- id: cache-pipenv | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Install dependencies | ||
if: steps.cache-pipenv.outputs.cache-hit != 'true' | ||
- name: Build Package | ||
run: | | ||
pipenv install --deploy --dev | ||
- name: Build a binary wheel and a source tarball | ||
python setup.py sdist bdist_wheel | ||
- name: Upload to PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
pipenv run build | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
python -m twine upload --skip-existing dist/* |