feat(specklepy): publish to pypi (#396)
* updates publish.yml * added the secrets * update publish.yml * updates workflow * updates workflows * Update github-action.yml * updates github action * updates docker-compose and deletes .devcontainer * disables pytests * changes the localhost * rollback - comment out the tests --------- Co-authored-by: KatKatKateryna <89912278+KatKatKateryna@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,9 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- "v3-dev"
|
||||
tags:
|
||||
- "v3.*.*"
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: continuous-integration
|
||||
@@ -39,8 +42,8 @@ jobs:
|
||||
- name: Run pre-commit
|
||||
run: uv run pre-commit run --all-files
|
||||
|
||||
# - name: Run Speckle Server
|
||||
# run: docker compose up -d
|
||||
- name: Run Speckle Server
|
||||
run: docker compose up -d
|
||||
|
||||
# - name: Run tests
|
||||
# run: uv run pytest --cov --cov-report xml:reports/coverage.xml --junitxml=reports/test-results.xml
|
||||
|
||||
@@ -1,31 +1,48 @@
|
||||
# Publish a release to PyPI.
|
||||
name: "Publish to PyPI"
|
||||
|
||||
name: "Publish Python Package"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "v3-dev"
|
||||
workflow_run:
|
||||
workflows: [Specklepy test and build]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
pypi-publish:
|
||||
name: Upload to PyPI
|
||||
publish-package:
|
||||
name: "Build and Publish Python Package"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# set the environment based on what triggered the workflow
|
||||
environment:
|
||||
name: testpypi
|
||||
name: ${{ contains(github.ref, 'refs/tags/v3') && 'pypi' || 'testpypi' }}
|
||||
|
||||
permissions:
|
||||
# For PyPI's trusted publishing.
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: "Install uv"
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# This is necessary so that we have the tags.
|
||||
fetch-depth: 0
|
||||
- name: "Build artifacts"
|
||||
|
||||
- name: "Build package artifacts"
|
||||
run: uv build
|
||||
- name: Publish to PyPi
|
||||
|
||||
# Logic for TestPyPI (on v3-dev branch push)
|
||||
- name: "Publish to TestPyPI"
|
||||
if: ${{ !contains(github.ref, 'refs/tags/v3') }}
|
||||
run: uv publish --index test
|
||||
|
||||
- name: Test package install
|
||||
- name: "Verify TestPyPI package installation"
|
||||
if: ${{ !contains(github.ref, 'refs/tags/v3') }}
|
||||
run: uv run --index test --with specklepy --no-project -- python -c "import specklepy"
|
||||
|
||||
# Logic for PyPI (on v3* tag creation)
|
||||
- name: "Publish to PyPI"
|
||||
if: ${{ contains(github.ref, 'refs/tags/v3') }}
|
||||
run: uv publish
|
||||
|
||||
- name: "Verify PyPI package installation"
|
||||
if: ${{ contains(github.ref, 'refs/tags/v3') }}
|
||||
run: uv run --with specklepy --no-project -- python -c "import specklepy"
|
||||
|
||||
Reference in New Issue
Block a user