Skip to content

Add Python package publishing to PR preview workflow#463

Open
andypettey wants to merge 5 commits intomainfrom
add-python-pr-preview-publish
Open

Add Python package publishing to PR preview workflow#463
andypettey wants to merge 5 commits intomainfrom
add-python-pr-preview-publish

Conversation

@andypettey
Copy link
Contributor

Summary

Extends the existing PR preview package publishing workflow to support both npm and Python packages published to GitHub Packages.

Changes

Workflow Updates

  • Updated trigger paths: Added packages/miro-api-python/** to trigger workflow on Python package changes
  • New job publish-python-preview: Runs in parallel with the existing npm publishing job

Python Package Publishing

  • Sets up Python 3.11 and Poetry build system
  • Configures Poetry to publish to GitHub Packages PyPI registry
  • Generates PEP 440 compliant preview versions
    • Format: {base_version}.dev{PR_number}+{short_sha}
    • Example: 2.2.4.dev123+abc1234
  • Builds and publishes Python package to https://pypi.pkg.github.com
  • Posts PR comment with installation instructions

Package Management

Both packages now publish to GitHub Packages on PR creation/updates:

Package Registry Scope
npm npm.pkg.github.com @miroapp/miro-api
Python pypi.pkg.github.com miro-api

Testing Instructions

When this PR is merged, any subsequent PR that modifies either package will automatically publish preview versions to GitHub Packages.

To test npm package:

echo "@miroapp:registry=https://npm.pkg.github.com" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN" >> .npmrc
npm install @miroapp/miro-api@VERSION

To test Python package:

pip install miro-api==VERSION \
  --index-url https://YOUR_USERNAME:YOUR_TOKEN@pypi.pkg.github.com/miroapp/simple/

Benefits

  • ✅ Test changes in real projects before merging
  • ✅ Parallel publishing keeps CI fast
  • ✅ Automatic versioning prevents conflicts
  • ✅ GitHub Packages integration (no external services needed)
  • ✅ Preview packages don't affect production releases

Notes

  • Preview packages are for testing only and won't affect production packages on npm/PyPI
  • Both jobs require packages: write permission (already configured)
  • Jobs only run for non-fork PRs for security

🤖 Generated with Claude Code

Extends the existing PR preview package publishing workflow to support
both npm and Python packages published to GitHub Packages.

Changes:
- Updated trigger paths to include packages/miro-api-python/**
- Added new publish-python-preview job that runs in parallel with npm job
- Configures Poetry to publish to GitHub Packages PyPI registry
- Generates PEP 440 compliant preview versions (e.g., 2.2.4.dev123+abc1234)
- Posts PR comment with Python package installation instructions

Both jobs run independently when PRs modify their respective packages,
allowing teams to test preview versions before merging.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Coverage report for commit: ef77a8a
File: packages/miro-api/coverage/clover.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ █░░░░░░░░░░░░░░░░░░░░░░ │  0.2%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ █░░░░░░░░░░░░░░░░░░░░░░ │  0.2%
  60% │ █░░░░░░░░░░░░░░░░░░░░░░ │  1.6%
  70% │ ████░░░░░░░░░░░░░░░░░░░ │  7.1%
  80% │ ██████████████░░░░░░░░░ │ 31.0%
  90% │ ███████████████████████ │ 52.4%
 100% │ ████░░░░░░░░░░░░░░░░░░░ │  7.5%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: 72.32% | Methods: 73.66% | Branches: 48.66%
FilesLinesMethodsBranches
packages/miro-api
   api.ts100.00%100.00%84.62%
   index.ts71.93%40.91%82.67%
   storage.ts100.00%100.00%66.67%
packages/miro-api/api
   apis.ts1.53%4.41%0.69%
packages/miro-api/highlevel
   Api.ts75.00%85.71%47.62%
   AppCardItem.ts100.00%100.00%73.33%
   Board.ts56.52%53.33%25.40%
   CardItem.ts100.00%100.00%73.33%
   DocumentItem.ts79.41%88.89%64.71%
   EmbedItem.ts100.00%100.00%73.33%
   FrameItem.ts83.33%100.00%36.00%
   ImageItem.ts79.41%88.89%64.71%
   Item.ts100.00%100.00%83.33%
   Organization.ts66.67%71.43%42.11%
   ShapeItem.ts100.00%100.00%73.33%
   StickyNoteItem.ts100.00%100.00%73.33%
   Tag.ts100.00%100.00%63.16%
   Team.ts60.00%71.43%34.78%
   TextItem.ts100.00%100.00%73.33%
   helpers.ts91.67%75.00%66.67%
   index.ts47.90%25.35%52.38%
packages/miro-api/model
   actor.ts85.71%77.78%66.67%
   addProjectMemberRequest.ts88.89%77.78%66.67%
   adminRole.ts89.66%80.00%64.71%
   appCardCreateRequest.ts80.00%77.78%66.67%
   appCardData.ts81.25%80.00%64.71%
   appCardDataChanges.ts83.87%80.00%64.71%
   appCardDataResponse.ts81.25%80.00%64.71%
   appCardItem.ts97.30%88.89%66.67%
   appCardStyle.ts92.31%77.78%66.67%
   appCardStylePlatformbulkcreateoperation.ts92.31%77.78%66.67%
   appCardUpdateRequest.ts80.00%77.78%66.67%
   auditContext.ts85.71%77.78%66.67%
   auditCreatedBy.ts83.87%80.00%64.71%
   auditEvent.ts72.73%77.78%66.67%
   auditObject.ts88.89%77.78%66.67%
   auditOrganization.ts88.89%77.78%66.67%
   auditPage.ts80.00%77.78%66.67%
   auditTeam.ts88.89%77.78%66.67%
   basicEntityInfo.ts88.89%77.78%66.67%
   basicError.ts82.76%77.78%66.67%
   basicErrorEnterpriseUserSessionResetEnterprisePlan.ts82.76%77.78%66.67%
   basicErrorOrganizationsEnterprisePlan.ts82.76%77.78%66.67%
   board.ts97.62%88.89%66.67%
   boardChanges.ts80.00%77.78%66.67%
   boardDataClassificationLabel.ts75.00%77.78%66.67%
   boardExportJob.ts72.73%77.78%66.67%
   boardExportJobCreator.ts92.31%77.78%66.67%
   boardExportJobId.ts92.31%77.78%66.67%
   boardExportJobStatus.ts92.31%77.78%66.67%
   boardExportJobTasksCount.ts85.71%77.78%66.67%
   boardExportJobTasksList.ts85.71%77.78%66.67%
   boardExportJobsList.ts85.71%77.78%66.67%
   boardExportResult.ts88.89%77.78%66.67%
   boardExportTask.ts75.00%77.78%66.67%
   boardExportTaskBoard.ts92.31%77.78%66.67%
   boardExportTaskExportLink.ts77.42%77.78%66.67%
   boardExportTaskResult.ts80.00%77.78%66.67%
   boardFormat.ts100.00%100.00%76.92%
   boardItemContentLog.ts72.97%80.00%64.71%
   boardLinks.ts88.89%77.78%66.67%
   boardMember.ts96.77%90.00%64.71%
   boardMemberChanges.ts92.86%80.00%64.71%
   boardMemberWithLinks.ts81.25%80.00%64.71%
   boardMembersInvite.ts86.67%80.00%64.71%
   boardMembersPagedResponse.ts75.00%77.78%66.67%
   boardPermissionsPolicy.ts87.50%80.00%64.71%
   boardPolicy.ts88.89%77.78%66.67%
   boardPolicyChange.ts88.89%77.78%66.67%
   boardProject.ts92.31%77.78%66.67%
   boardSharingPolicy.ts82.86%80.00%64.71%
   boardSharingPolicyChange.ts85.29%80.00%64.71%
   boardSubscription.ts76.47%80.00%64.71%
   boardSubscriptionData.ts92.31%77.78%66.67%
   boardUserGroup.ts86.67%80.00%64.71%
   boardUserGroupsPage.ts80.00%77.78%66.67%
   boardWithLinks.ts58.54%77.78%66.67%
   boardWithLinksAndLastOpened.ts55.81%77.78%66.67%
   boardWithLinksAndWithoutProject.ts60.00%77.78%66.67%
   boardsPagedResponse.ts75.00%77.78%66.67%
   bulkOperationError.ts80.00%77.78%66.67%
   bulkOperationErrorContext.ts92.31%77.78%66.67%
   bulkSubOperationError.ts85.71%77.78%66.67%
   caption.ts86.67%80.00%64.71%
   cardCreateRequest.ts80.00%77.78%66.67%
   cardData.ts82.76%77.78%66.67%
   cardDataPlatformbulkcreateoperation.ts82.76%77.78%66.67%
   cardItem.ts97.30%88.89%66.67%
   cardStyle.ts92.31%77.78%66.67%
   cardStylePlatformbulkcreateoperation.ts92.31%77.78%66.67%
   cardUpdateRequest.ts80.00%77.78%66.67%
   caseRequest.ts88.89%77.78%66.67%
   caseResponse.ts72.73%77.78%66.67%
   connectorChangesData.ts81.25%80.00%64.71%
   connectorCreationData.ts81.25%80.00%64.71%
   connectorStyle.ts76.32%80.00%64.71%
   connectorWithLinks.ts97.50%90.00%64.71%
   connectorsCursorPaged.ts77.42%77.78%66.67%
   copyBoardChanges.ts82.76%77.78%66.67%
   createBoardExportRequest.ts88.89%77.78%66.67%
   createBoardSubscriptionRequest.ts86.67%80.00%64.71%
   createBoardUserGroupsRequest.ts89.66%80.00%64.71%
   createDocumentItemUsingFileFromDeviceRequestData.ts82.76%77.78%66.67%
   createFrameItem400Response.ts82.76%77.78%66.67%
   createGroupMemberRequest.ts92.31%77.78%66.67%
   createGroupRequest.ts88.89%77.78%66.67%
   createProjectRequest.ts92.31%77.78%66.67%
   createProjectUserGroupsRequest.ts89.66%80.00%64.71%
   createTeamGroupRequest.ts89.66%80.00%64.71%
   createTeamRequest.ts92.31%77.78%66.67%
   createUserResource.ts70.27%80.00%64.71%
   createUserResourceName.ts85.71%77.78%66.67%
   createUserResourcePhotosInner.ts88.89%77.78%66.67%
   createUserResourceRolesInner.ts82.76%77.78%66.67%
   createUserResourceUrnIetfParamsScimSchemasExtensionEnterprise20User.ts77.42%77.78%66.67%
   createUserResourceUrnIetfParamsScimSchemasExtensionEnterprise20UserManager.ts88.89%77.78%66.67%
   createdBy.ts88.89%77.78%66.67%
   createdByPlatformContainers.ts88.89%77.78%66.67%
   createdByPlatformExperimentalFeatures.ts88.89%77.78%66.67%
   createdByPlatformFileUpload.ts88.89%77.78%66.67%
   createdByPlatformTags.ts88.89%77.78%66.67%
   createdByPlatformcreateitemsinbulkusingfilefromdevice.ts88.89%77.78%66.67%
   createdByPlatformgroups.ts88.89%77.78%66.67%
   customField.ts78.79%80.00%64.71%
   customFieldPlatformTags.ts78.79%80.00%64.71%
   customFieldPlatformbulkcreateoperation.ts78.79%80.00%64.71%
   dataClassificationLabel.ts70.59%77.78%66.67%
   dataClassificationLabelId.ts92.31%77.78%66.67%
   dataClassificationOrganizationSettings.ts85.71%77.78%66.67%
   dataClassificationTeamSettings.ts85.71%77.78%66.67%
   docFormatCreateRequest.ts85.71%77.78%66.67%
   docFormatData.ts86.67%80.00%64.71%
   docFormatDataPlatform.ts86.67%80.00%64.71%
   docFormatHtmlData.ts86.67%80.00%64.71%
   docFormatItem.ts68.57%77.78%66.67%
   docFormatMarkdownData.ts86.67%80.00%64.71%
   documentCreateRequest.ts85.71%77.78%66.67%
   documentData.ts88.89%77.78%66.67%
   documentDataResponse.ts88.89%77.78%66.67%
   documentDataResponsePlatformcreateitemsinbulkusingfilefromdevice.ts88.89%77.78%66.67%
   documentItem.ts97.22%88.89%66.67%
   documentItemPlatformFileUpload.ts66.67%77.78%66.67%
   documentUpdateRequest.ts82.76%77.78%66.67%
   documentUrlData.ts88.89%77.78%66.67%
   documentUrlDataChanges.ts88.89%77.78%66.67%
   documentUrlDataPlatformbulkcreateoperation.ts88.89%77.78%66.67%
   embedCreateRequest.ts82.76%77.78%66.67%
   embedData.ts72.22%80.00%64.71%
   embedDataResponse.ts72.22%80.00%64.71%
   embedItem.ts97.22%88.89%66.67%
   embedUpdateRequest.ts82.76%77.78%66.67%
   embedUrlData.ts86.67%80.00%64.71%
   embedUrlDataChanges.ts86.67%80.00%64.71%
   embedUrlDataPlatformbulkcreateoperation.ts86.67%80.00%64.71%
   enterpriseGetOrganizationMembers200Response.ts80.00%77.78%66.67%
   enterpriseUpdateBoardExportJob200Response.ts92.31%77.78%66.67%
   enterpriseUpdateBoardExportJob200ResponseStatus.ts92.31%77.78%66.67%
Table truncated to fit comment

🤖 comment via lucassabreu/comment-coverage-clover

Add documentation to both npm and Python package READMEs about
testing preview packages published via PR workflow.

This change will trigger the workflow to test both package builds.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📦 Preview Package Published

A preview version of @mirohq/miro-api has been published to GitHub Packages for testing as @miroapp/miro-api.

Preview Version: 2.2.4-pr463.f57912a

Installation Instructions

  1. Create or update your .npmrc file in your project root:

    @miroapp:registry=https://npm.pkg.github.com
    
  2. Authenticate with GitHub Packages:

    Generate a Personal Access Token (PAT) with read:packages scope:

    Add to your .npmrc file:

    //npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
    

    Note: Keep your .npmrc file private and don't commit it to version control.

  3. Install the preview package:

    npm install @miroapp/miro-api@2.2.4-pr463.f57912a

    Or with yarn:

    yarn add @miroapp/miro-api@2.2.4-pr463.f57912a

⚠️ This is a preview package for testing purposes only. It will not affect the production package on npm.

You can view this package in GitHub Packages.

andypettey and others added 3 commits February 13, 2026 20:53
- Fix pyproject.toml: Move URLs from [project.urls] to [tool.poetry.urls]
  to resolve Poetry validation error
- Add detailed GitHub Packages setup documentation with:
  - Step-by-step PAT creation instructions
  - Multiple installation methods (pip, Poetry, config files)
  - Security best practices and .gitignore recommendations
  - Troubleshooting guide for common errors

This resolves the "project must contain ['name'] properties" error
in the preview package publishing workflow.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changes GitHub Packages approach to workflow artifacts for Python packages,
as GitHub Packages has limited PyPI protocol support.

Changes:
- Replace GitHub Packages PyPI publishing with workflow artifact uploads
- Update PR comment to include artifact download instructions
- Simplify Python README testing section with artifact-based workflow
- Remove complex GitHub Packages authentication setup
- Add GitHub CLI download option for easier testing

Benefits:
- No authentication required to download artifacts
- Simpler installation process (direct pip install from .whl file)
- More reliable than GitHub Packages PyPI registry
- 30-day artifact retention for testing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix deprecated v3 of upload-artifact action to use v4.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

🐍 Python Preview Package Built

A preview version of miro-api Python package has been built and is available for testing.

Preview Version: 2.2.4.dev463+f57912a

Installation Instructions

Option 1: Download and Install from Artifacts (Recommended)

  1. Download the package files:

    • Go to the workflow run artifacts
    • Download the python-preview-package-pr463 artifact
    • Extract the ZIP file to get the .whl and .tar.gz files
  2. Install the wheel file:

    pip install miro_api-2.2.4.dev463+f57912a-py3-none-any.whl

    Or install from the source distribution:

    pip install miro_api-2.2.4.dev463+f57912a.tar.gz

Option 2: Direct Installation with GitHub CLI

If you have GitHub CLI installed:

# Download artifact
gh run download 22000888226 -n python-preview-package-pr463

# Install the wheel
pip install miro_api-2.2.4.dev463+f57912a-py3-none-any.whl

Option 3: Install with Poetry

# Download the wheel file first, then:
poetry add ./miro_api-2.2.4.dev463+f57912a-py3-none-any.whl

⚠️ This is a preview package for testing purposes only. It will not affect the production package on PyPI.

📦 Artifact Name: python-preview-package-pr463
🔗 Download: View workflow artifacts

@andypettey andypettey requested review from a team and horeaporutiu February 13, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant