Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update publish script for multi-platform builds #258

Merged
merged 6 commits into from
Jan 13, 2025

Conversation

Hellebore
Copy link
Contributor

@Hellebore Hellebore commented Jan 13, 2025

Checklist

  • If package.json or yarn.lock have changed, then test the VSIX built by yarn run vsce package works from a direct install

Summary by Sourcery

CI:

  • Build and publish VSIX packages for Windows, macOS (x64 and arm64), and Linux.

Copy link
Contributor

sourcery-ai bot commented Jan 13, 2025

Reviewer's Guide by Sourcery

This PR updates the publish script to build and publish multi-platform VSIX packages.

Sequence diagram for multi-platform build and publish process

sequenceDiagram
    participant Matrix as Build Matrix
    participant Runner as GitHub Runner
    participant Artifacts as Artifacts Storage
    participant VSCode as VS Code Marketplace
    participant GitHub as GitHub Releases

    Matrix->>Runner: Start parallel builds for each platform
    loop For each platform
        Runner->>Runner: Download binaries
        Runner->>Runner: Update version
        Runner->>Runner: Package VSIX
        Runner->>Artifacts: Upload platform-specific VSIX
    end
    Runner->>Artifacts: Download all artifacts
    Runner->>VSCode: Publish all platform VSIXs
    Runner->>GitHub: Create release with all VSIXs
Loading

[FILTERED - Architecture diagrams are low quality] Architecture diagram for multi-platform VSIX build and publish workflow

flowchart TB
    subgraph package[Package VSIX Job Matrix]
        direction TB
        win[Windows x64]-->pkg1[Package VSIX]
        linux[Linux x64]-->pkg2[Package VSIX]
        macx64[macOS x64]-->pkg3[Package VSIX]
        macarm[macOS ARM64]-->pkg4[Package VSIX]
        pkg1 & pkg2 & pkg3 & pkg4 -->|Upload| artifacts[(Artifacts Storage)]
    end

    subgraph publish[Publish Job]
        direction TB
        download[Download Artifacts]-->merge[Merge Artifacts]
        merge-->publish_vsix[Publish to VS Code Marketplace]
        merge-->create_release[Create GitHub Release]
    end

    package-->|Dependencies|publish
Loading

File-Level Changes

Change Details Files
Adds multi-platform build support
  • A matrix strategy is used to build for Windows, macOS (x64 and arm64), and Linux.
  • The VSIX is packaged for each target platform using the --target flag.
  • The packaged VSIX files are renamed to include the version and target platform.
  • The artifacts are uploaded for each platform.
.github/workflows/publish.yml
Publishes multi-platform VSIX packages
  • The publish job now depends on the package job.
  • All packaged VSIX files are downloaded as artifacts.
  • The vsce publish command is updated to publish all downloaded VSIX files.
.github/workflows/publish.yml
Updates release artifacts
  • The release now includes all platform-specific VSIX files as artifacts.
.github/workflows/publish.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Hellebore - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Since this PR adds multi-platform builds, consider updating the checklist to verify the VSIX package works on all target platforms (Windows, Linux, Mac x64, Mac ARM64)
Here's what I looked at during the review
  • 🟢 Functionality: all looks good
  • 🟡 General issues: 1 issue found
  • 🟡 Security: 1 issue found
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

LangSmith trace

Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Hellebore Hellebore requested a review from brendanator January 13, 2025 11:13
Copy link
Contributor

@brendanator brendanator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Do you actually have to merge this before testing it? Or can you test it and remove the TODOs before merging?

@Hellebore Hellebore merged commit 4ffc618 into main Jan 13, 2025
1 check passed
@Hellebore Hellebore deleted the nick/ci/publish-script branch January 13, 2025 16:28
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.

2 participants