Skip to content

Add pkg.pr.new snapshot publishing workflow for main/PR with single-build CI gating#752

Merged
patroza merged 6 commits into
mainfrom
copilot/setup-snapshot-builds
May 16, 2026
Merged

Add pkg.pr.new snapshot publishing workflow for main/PR with single-build CI gating#752
patroza merged 6 commits into
mainfrom
copilot/setup-snapshot-builds

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

We need snapshot builds for main and PRs without duplicating build work. This PR adds a dedicated snapshot publish workflow and updates reusable CI so snapshot publishing reuses lint/test gates while building only once.

  • Snapshot workflow (.github/workflows/snapshot.yml)

    • Added triggers for push to main, pull_request to main, and workflow_dispatch.
    • Added CI gate via reusable workflow before publishing.
    • Added snapshot versioning using Changesets snapshot mode.
    • Switched publishing from npm dist-tags to pkg.pr.new:
      • Publishes all workspace packages in one command via pnpm exec pkg-pr-new publish ./packages/*
      • Uses pkg.pr.new outputs (packages, urls, sha) for the job summary
      • Fails fast if expected pkg.pr.new outputs are missing
    • Added publish guardrails:
      • skip fork PR publishes
      • skip release/version-bump bot commits
    • Added consumer install docs to job summary using pkg.pr.new package locators and URLs.
    • Added pkg-pr-new as a pinned dev dependency (0.0.73) to ensure lockfile-backed workflow execution.
  • No double build (.github/workflows/ci.yml + snapshot caller)

    • Extended reusable CI with workflow_call.inputs.run_build (default true).
    • build job now respects run_build.
    • Snapshot workflow calls CI with run_build: false, then performs exactly one build in publish job.
  • Example of the build de-duplication path

    # .github/workflows/ci.yml
    on:
      workflow_call:
        inputs:
          run_build:
            required: false
            type: boolean
            default: true
    
    jobs:
      build:
        if: ${{ github.event_name != 'workflow_call' || inputs.run_build }}
    
    # .github/workflows/snapshot.yml
    jobs:
      ci:
        uses: ./.github/workflows/ci.yml
        with:
          run_build: false

Copilot AI and others added 3 commits May 16, 2026 08:46
@patroza
Copy link
Copy Markdown
Member

patroza commented May 16, 2026

@copilot why is this PR not creating snapshots?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 16, 2026

@copilot why is this PR not creating snapshots?

Root cause: the snapshot workflow run was failing before any jobs started (0 jobs), so no publish step executed. I fixed the job condition expression so the workflow can evaluate and run correctly in commit c588af5. Please re-run the snapshot workflow (or push a new commit) and it should publish the snapshot tags.

Copilot AI requested a review from patroza May 16, 2026 09:07
@patroza
Copy link
Copy Markdown
Member

patroza commented May 16, 2026

@copilot can you enable snapshots for pre mode?

🦋 error Snapshot release is not allowed in pre mode
🦋 To resolve this exit the pre mode by running changeset pre exit

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 16, 2026

@copilot can you enable snapshots for pre mode?

🦋 error Snapshot release is not allowed in pre mode
🦋 To resolve this exit the pre mode by running changeset pre exit

Fixed in 01e10e5. Snapshot workflow now exits Changesets pre mode before changeset version --snapshot:

if [ -f .changeset/pre.json ]; then
  pnpm changeset pre exit
fi

This unblocks snapshot publishing when the repo is in pre mode.

@patroza
Copy link
Copy Markdown
Member

patroza commented May 16, 2026

@copilot why is it trying to publish to pnpm instead of the pkg new thing

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 16, 2026

@copilot why is it trying to publish to pnpm instead of the pkg new thing

It’s using pnpm as the publish CLI, but it is publishing to npmjs (not a pnpm registry). In the latest run, publish failed with:
npm ERR! need auth ... https://registry.npmjs.org/

So this isn’t targeting pkg.pr.new right now—the workflow is configured for npm snapshots via pnpm -r publish. If you want, I can switch the snapshot job to the pkg.pr.new flow instead.

@patroza
Copy link
Copy Markdown
Member

patroza commented May 16, 2026

@copilot yea that’s what this is about

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 16, 2026

@copilot yea that’s what this is about

Done in 730ecc2. Snapshot publishing now uses pkg.pr.new instead of npm dist-tags:

  • pnpm exec pkg-pr-new publish ./packages/*
  • removed npm token/dist-tag publish path
  • added pkg-pr-new as a pinned dev dependency in the lockfile
  • summary now reports pkg.pr.new locators/URLs and fails fast if expected outputs are missing.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • pkg.pr.new
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add snapshot publishing workflow for main/PR with single-build CI gating Add pkg.pr.new snapshot publishing workflow for main/PR with single-build CI gating May 16, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 16, 2026

Open in StackBlitz

@effect-app/cli

npm i https://pkg.pr.new/effect-app/libs/@effect-app/cli@752

effect-app

npm i https://pkg.pr.new/effect-app/libs/effect-app@752

@effect-app/eslint-codegen-model

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-codegen-model@752

@effect-app/eslint-shared-config

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-shared-config@752

@effect-app/infra

npm i https://pkg.pr.new/effect-app/libs/@effect-app/infra@752

@effect-app/vue

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue@752

@effect-app/vue-components

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue-components@752

commit: 730ecc2

@patroza patroza merged commit 0e084f0 into main May 16, 2026
5 of 8 checks passed
@patroza patroza deleted the copilot/setup-snapshot-builds branch May 16, 2026 10:17
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