Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,24 @@ jobs:
with:
name: coverage-report-py${{ matrix.python-version }}
path: htmlcov/

create_wheel_and_sdist:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
with:
python-version: '3.13'

- name: Build wheel and sdist
run: uv build

- name: Upload wheel and sdist as artifact
uses: actions/upload-artifact@v7
with:
name: Package-Distributions-construct-editor
path: dist/
39 changes: 19 additions & 20 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
create_wheel_and_sdist:
name: create_wheel_and_sdist
uses: ./.github/workflows/ci.yml

deploy:
needs: [ create_wheel_and_sdist ]
runs-on: ubuntu-latest

environment: pypi
permissions:
id-token: write # IMPORTANT: this permission is mandatory for Trusted Publishing
Comment thread
timrid marked this conversation as resolved.

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v7

- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: Package-Distributions-construct-editor
path: ./dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1