Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/pkg.pr.new.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
name: Publish to pkg.pr.new

# Publishes a continuous preview release to https://pkg.pr.new whenever a
# maintainer adds the `pkg.pr.new` label to a pull request (or via manual
# dispatch). Requires the pkg.pr.new GitHub App to be installed on the repo:
# Publishes a continuous preview release to https://pkg.pr.new on:
# - every push to `main` (canary install of the latest main commit)
# - when a maintainer adds the `pkg.pr.new` label to a pull request
# - manual workflow_dispatch
#
# Requires the pkg.pr.new GitHub App to be installed on the repo:
# https://github.com/apps/pkg-pr-new

# One-shot per label by design (matches rolldown's PR preview): a preview is
# built only when the `pkg.pr.new` label itself is added (the job guards check
# the triggering label, github.event.label.name, NOT the full label set, so
# adding any other label to an already-labeled PR does not rebuild).
# `synchronize` is intentionally NOT subscribed, so later commits do not
# `synchronize` is intentionally NOT subscribed, so later PR commits do not
# rebuild — re-apply the label or use workflow_dispatch to refresh. This avoids
# an 8-platform native build on every push.
# an 8-platform native build on every PR push. Main-branch pushes always build.
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [labeled]

permissions: {}

# Cancel an in-flight preview when the label is re-applied on the same PR.
# Cancel an in-flight preview when the label is re-applied on the same PR,
# or when a newer main push supersedes a previous main publish.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -33,6 +40,7 @@ jobs:
if: >
github.repository == 'voidzero-dev/oxc-angular-compiler' &&
(github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.label.name == 'pkg.pr.new'))
permissions:
contents: read
Expand All @@ -43,6 +51,7 @@ jobs:
if: >
github.repository == 'voidzero-dev/oxc-angular-compiler' &&
(github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.label.name == 'pkg.pr.new'))
needs: build
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Reusable Build

# Builds the native NAPI bindings for every target and uploads them as
# `bindings-<target>` artifacts. Called by both `release.yml` (tag releases)
# and `pkg.pr.new.yml` (PR preview packages) so the build matrix lives in one
# place.
# and `pkg.pr.new.yml` (main canary + PR preview packages) so the build matrix
# lives in one place.

on:
workflow_call:
Expand Down
Loading