Skip to content

Commit

Permalink
Merge pull request #21 from JorisPenningsCM/fix/default-gateways
Browse files Browse the repository at this point in the history
Update python-publish.yml
  • Loading branch information
JorisPenningsCM committed Jun 13, 2024
2 parents c413d1f + 4e15339 commit a906bd4
Showing 1 changed file with 37 additions and 18 deletions.
55 changes: 37 additions & 18 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,45 @@ on:
release:
types: [published]

jobs:
deploy:
runs-on: windows-latest
jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --user --upgrade setuptools wheel
python setup.py sdist bdist_wheel
pip install setuptools wheel twine
- name: Build and publish
python-version: "3.x"
- name: Install pypa/build
run: python3 -m pip install build
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

pypi-publish:
name: Publish Python distribution to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/cm-text-sdk-python
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: read # Add the contents permission for accessing repository contents
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_PUBLISH_TOKEN }}
run: |
python setup.py sdist bdist_wheel
python -m pip install --user --upgrade twine
python -m twine upload --repository pypi dist/*
python3 -m pip install twine
twine upload dist/*

0 comments on commit a906bd4

Please sign in to comment.