Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@eunicode
Copy link

@eunicode eunicode commented Jul 18, 2025

Closes #1065

Overview

This PR introduces a new GitHub Actions workflow: continuous-release.yml.
The workflow runs on:

  • Pushes to the default branch (aka merges to main)
  • Pull request events

It automatically builds and publishes packages to pkg.pr.new's registry.

For pull requests, pkg.pr.new comments with installation URLs for packages, and updates the comments with every new commit.

Example pkg.pr.new PR comment:
Screen Shot 2025-07-18 at 3 15 32 PM

In the absence of pull requests, you can access package URLs by manually constructing them using this format:

https://pkg.pr.new/reatom/reatom/@reatom/<package-name>@<commit-hash>

Or browse published packages at: https://pkg.pr.new/~/reatom/reatom

Motivation

Reatom packages are typically released in batches. This workflow introduces a "continuous release" strategy by leveraging pkg.pr.new, which allows:

  • Sharing experimental builds immediately
  • Publishing hotfixes without waiting for a full release cycle

How It Works

Setup

In order to use pkg.pr.new, you must install the pkg.pr.new GitHub application on the repository: https://github.com/apps/pkg-pr-new

Features

  • Triggering: PR events and pushes to default branch
  • Concurrency: Cancels in-progress runs on new commits to the same PR
  • Environment:
    • OS: ubuntu-latest
    • Node.js: 22.13.1
    • pnpm: 10.12.1
  • Steps:
    • Checkout code
    • Set up Node.js and pnpm
    • Install dependencies via pnpm install
    • Build packages using Turbo
    • Publish packages via pnpm dlx pkg-pr-new

More Notes

Question: Should the push trigger be removed from the workflow? Since all changes are merged through pull requests, and those PRs already trigger the workflow, it may be redundant to run it again on pushing to main.

Notes & Considerations

  • No Node.js caching: Skipped due to missing lockfile
  • Versioning: Follows versions used in lint.yml, test.yml, and package.json
  • StackBlitz preview: Disabled as it's not relevant for package publishing

Optional Enhancements

  • Add a pkg.pr.new badge to the README
  • Conditionally publish only if lint/tests pass
    (Note: skipped for now, as tests may be outdated, and we want to allow previews even if they fail)
  • Use Turbo caching to cut build times further
    (requires setting up credentials/secrets)
  • Optimize by only building and publishing changed packages (reduces time by ~50% or ~40s per run, but additional scripting may make it less maintainable):
Expand to view code snippet for changed package detection
set -euo pipefail
# Get packages changed vs upstream base and include dependents
npx turbo run build --filter=...[upstream/${{ github.base_ref }}...HEAD] --dry=json \
  | jq -r '.tasks[].directory' \
  | sort -u > changed-dirs.txt

if [ ! -s changed-dirs.txt ]; then
  echo "paths=" >> "$GITHUB_OUTPUT"
  echo "No changed packages."
else
  CHANGED_PATHS=$(sed -e 's|^|./|' changed-dirs.txt | xargs)
  echo "paths=$CHANGED_PATHS" >> "$GITHUB_OUTPUT"
  echo "Changed paths: $CHANGED_PATHS"
fi

@romadryud romadryud self-requested a review August 3, 2025 19:25
Copy link
Collaborator

@romadryud romadryud left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution 🚀 ! I've left some comments. I noticed there is an overall issue with our pipeline. I will create a fix in a few days, and you can rebase after that. I'll ping you once it's ready.

Co-authored-by: Raman Aktsisiuk <[email protected]>
@eunicode eunicode force-pushed the add-preview-release-1065 branch from 5f9da0e to 2bedd80 Compare August 16, 2025 01:14
Copy link
Collaborator

@artalar artalar left a comment

Choose a reason for hiding this comment

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

@romadryud can you make a review one more time pls?

@romadryud
Copy link
Collaborator

@eunicode Looks good to me; Thank you 🚀 🔥 . Let's re-run it today after my pr and see how it works.

cc: @artalar

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.

add Continuous Releases to the CI

3 participants