Skip to content

Commit

Permalink
Update publish_package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
james03160927 authored May 2, 2024
1 parent ea45595 commit f394f20
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,32 @@ on:
types: [ created ]

jobs:
pypi-publish:
name: Upload release to PyPI
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/comfy-cli/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
# retrieve your distributions here
- name: pypi-publish
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install build dependencies
run: python -m pip install --upgrade pip build

- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Update version in pyproject.toml
run: |
python -c "import toml; pyproj = toml.load('pyproject.toml'); pyproj['project']['version'] = '${{ env.VERSION }}'; toml.dump(pyproj, open('pyproject.toml', 'w'))"
- name: Build distribution
run: python -m build --sdist --wheel --outdir dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.14


Expand Down

0 comments on commit f394f20

Please sign in to comment.