Merge origin/main into Jinwoo-H/mobile-ui-polish
Resolved conflicts across shared settings, preload APIs, runtime RPC, and the experimental settings pane. Kept both the Mobile Pairing feature (HEAD) and the Sidekick feature (main) as sibling experimental entries, with Orchestration shifting to index 3 in EXPERIMENTAL_PANE_SEARCH_ENTRIES. Extracted HiddenExperimentalGroup and SupportedAgentsDisclaimer from ExperimentalPane.tsx into their own files to stay under the 400-line oxlint cap after the merge increased the file size. In pane-tree-ops.ts, kept main's PR #1298 WebGL reattach logic (moved to pane-split-scroll.ts) and dropped HEAD's inline pendingSplitScrollState workaround. Kept the mobile-fit-override lookup from HEAD. In runtime-rpc.ts, kept main's sweepOrphanedRuntimeSockets startup call alongside HEAD's WebSocket transport. Renamed singular transport field to transports array in runtime-metadata.test.ts fixtures. In orca-runtime.ts, merged main's getEffectiveHooks(repo, worktreePath) signature with HEAD's setupDecision/shouldRunSetupForCreate logic. In pty.ts, preserved HEAD's semantics of notifying runtime?.onPtyData before the isDestroyed() check so mobile clients still receive data when the desktop window is closed. Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -0,0 +1,163 @@
|
||||
name: Homebrew Cask Bump
|
||||
|
||||
# Why: keep the stablyai/homebrew-orca tap in sync with GitHub Releases.
|
||||
# Triggers:
|
||||
# - release.published with !prerelease → release workflow just finalized a
|
||||
# stable tag (see publish-release step in release.yml)
|
||||
# - workflow_call → release.yml finished publishing a stable tag
|
||||
# - workflow_dispatch → manual backfill for a specific tag
|
||||
#
|
||||
# The job computes the sha256 of orca-macos-arm64.dmg + orca-macos-x64.dmg
|
||||
# from the release, templates Casks/orca.rb in this repo with the new
|
||||
# version and hashes, then PRs the result into stablyai/homebrew-orca. It
|
||||
# does NOT run for -rc.* tags: the stable cask should only track GA.
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag:
|
||||
description: Release tag to sync (e.g. v1.3.25)
|
||||
required: true
|
||||
type: string
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Release tag to sync (e.g. v1.3.25)
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
bump-cask:
|
||||
runs-on: ubuntu-latest
|
||||
# Why: skip prereleases and RC tags. The stable cask tracks GA only; a
|
||||
# beta channel would be a separate cask in a separate job.
|
||||
if: >
|
||||
inputs.tag != '' ||
|
||||
(github.event.release.prerelease == false &&
|
||||
!contains(github.event.release.tag_name, '-rc.'))
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout orca
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Resolve tag and version
|
||||
id: tag
|
||||
env:
|
||||
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ -n "$INPUT_TAG" ]]; then
|
||||
tag="$INPUT_TAG"
|
||||
else
|
||||
tag="$RELEASE_TAG"
|
||||
fi
|
||||
version="${tag#v}"
|
||||
echo "tag=$tag" >>"$GITHUB_OUTPUT"
|
||||
echo "version=$version" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Download DMGs and compute sha256
|
||||
id: hash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ steps.tag.outputs.tag }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p dmgs
|
||||
gh release download "$TAG" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--pattern 'orca-macos-arm64.dmg' \
|
||||
--pattern 'orca-macos-x64.dmg' \
|
||||
--dir dmgs
|
||||
arm=$(sha256sum dmgs/orca-macos-arm64.dmg | awk '{print $1}')
|
||||
intel=$(sha256sum dmgs/orca-macos-x64.dmg | awk '{print $1}')
|
||||
echo "arm=$arm" >>"$GITHUB_OUTPUT"
|
||||
echo "intel=$intel" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Render updated cask file
|
||||
env:
|
||||
VERSION: ${{ steps.tag.outputs.version }}
|
||||
ARM_SHA: ${{ steps.hash.outputs.arm }}
|
||||
INTEL_SHA: ${{ steps.hash.outputs.intel }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
python3 - <<'PY'
|
||||
import os, re, pathlib
|
||||
p = pathlib.Path("Casks/orca.rb")
|
||||
src = p.read_text()
|
||||
src = re.sub(r'version "[^"]+"',
|
||||
f'version "{os.environ["VERSION"]}"', src, count=1)
|
||||
src = re.sub(r'sha256 arm:\s*"[0-9a-f]+",\s*\n\s*intel:\s*"[0-9a-f]+"',
|
||||
'sha256 arm: "{arm}",\n intel: "{intel}"'.format(
|
||||
arm=os.environ["ARM_SHA"],
|
||||
intel=os.environ["INTEL_SHA"]),
|
||||
src, count=1)
|
||||
p.write_text(src)
|
||||
print(src)
|
||||
PY
|
||||
|
||||
# Why: reuse the existing buf0-bot GitHub App (also used by
|
||||
# track-community-prs.yaml) instead of minting a new PAT. The app is
|
||||
# installed org-wide, so it has access to stablyai/homebrew-orca
|
||||
# automatically. GITHUB_TOKEN cannot push cross-repo; a short-lived
|
||||
# installation token can.
|
||||
- name: Generate buf0-bot token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: 2590194
|
||||
private-key: ${{ secrets.BUFO_BOT_PRIVATE_KEY }}
|
||||
owner: stablyai
|
||||
repositories: homebrew-orca
|
||||
|
||||
- name: Checkout tap
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: stablyai/homebrew-orca
|
||||
path: tap
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
- name: Copy cask into tap and open PR
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
VERSION: ${{ steps.tag.outputs.version }}
|
||||
TAG: ${{ steps.tag.outputs.tag }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p tap/Casks
|
||||
cp Casks/orca.rb tap/Casks/orca.rb
|
||||
|
||||
cd tap
|
||||
# Why: commit author must match the buf0-bot app so commits are
|
||||
# attributed to the bot in the tap's history / PR UI.
|
||||
git config user.name "buf0-bot[bot]"
|
||||
git config user.email "252831055+buf0-bot[bot]@users.noreply.github.com"
|
||||
|
||||
if git diff --quiet; then
|
||||
echo "Cask already up-to-date for $TAG; nothing to do."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
branch="bump/orca-$VERSION"
|
||||
git checkout -b "$branch"
|
||||
git add Casks/orca.rb
|
||||
git commit -m "orca $VERSION"
|
||||
git push -u origin "$branch" --force
|
||||
|
||||
# Why: prefer --fill so the PR body matches the commit; fall back
|
||||
# to a brief body if the PR already exists for this branch.
|
||||
gh pr create \
|
||||
--title "orca $VERSION" \
|
||||
--body "Automated bump from stablyai/orca release $TAG." \
|
||||
--base main \
|
||||
--head "$branch" \
|
||||
|| gh pr edit "$branch" --title "orca $VERSION"
|
||||
|
||||
# Why: squash-merge immediately rather than --auto. The tap has no
|
||||
# required checks or branch protection, and `gh pr merge --auto`
|
||||
# only activates when there's something to wait on — on a repo
|
||||
# with no gates it silently no-ops, leaving the PR open forever.
|
||||
gh pr merge "$branch" --squash --delete-branch
|
||||
@@ -1,9 +1,9 @@
|
||||
name: Cut Release
|
||||
|
||||
# Why: single entry point for manually cutting a release from any ref.
|
||||
# Replaces the old local `pnpm release:*` scripts so releases are always
|
||||
# reproducible from CI and can never be accidentally tagged against an
|
||||
# uncommitted or non-main working tree.
|
||||
# Why: single entry point for manually and scheduled cutting releases.
|
||||
# Replaces the old local `pnpm release:*` scripts and the standalone scheduled
|
||||
# RC workflow so releases are always reproducible from CI and can never be
|
||||
# accidentally tagged against an uncommitted or non-main working tree.
|
||||
#
|
||||
# Flow:
|
||||
# 1. Resolve `ref` to a SHA.
|
||||
@@ -36,6 +36,17 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: main
|
||||
dry_run:
|
||||
description: Validate a scheduled-RC run without creating a tag
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
schedule:
|
||||
# Why: GitHub scheduled workflows are not guaranteed to start exactly on
|
||||
# time and can be delayed or dropped around high-load periods. We retry
|
||||
# across the full target hour and dedupe per PT slot. Cron is UTC, so run
|
||||
# during both PST and PDT equivalents and let the PT-hour gate decide.
|
||||
- cron: '*/5 10,11,22,23 * * *'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -49,12 +60,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
outputs:
|
||||
tag: ${{ steps.tag.outputs.tag }}
|
||||
tag: ${{ steps.tag.outputs.tag || steps.version.outputs.recovered_tag }}
|
||||
should_release: ${{ steps.window.outputs.allowed == 'true' && steps.existing.outputs.already_ran != 'true' && !(github.event_name == 'workflow_dispatch' && inputs.dry_run) }}
|
||||
steps:
|
||||
- name: Checkout ref
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
||||
ref: ${{ github.event_name == 'schedule' && 'main' || inputs.ref }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
@@ -84,11 +96,90 @@ jobs:
|
||||
echo "push_main=false" >>"$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Compute RC slot
|
||||
id: slot
|
||||
run: |
|
||||
slot=$(TZ=America/Los_Angeles date '+%Y-%m-%d-%H')
|
||||
echo "value=$slot" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Validate PT release window
|
||||
id: window
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
run: |
|
||||
if [[ "$EVENT_NAME" != "schedule" ]]; then
|
||||
echo "allowed=true" >>"$GITHUB_OUTPUT"
|
||||
echo "reason=manual" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pt_hour=$(TZ=America/Los_Angeles date '+%H')
|
||||
pt_minute=$(TZ=America/Los_Angeles date '+%M')
|
||||
|
||||
# Why: GitHub may deliver a scheduled event long after the intended
|
||||
# time, so delayed 4:16 AM runs must not cut the 3:00 AM release.
|
||||
if [[ "$pt_hour" == "03" || "$pt_hour" == "15" ]]; then
|
||||
echo "allowed=true" >>"$GITHUB_OUTPUT"
|
||||
echo "reason=target_hour:${pt_hour}:${pt_minute}" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "allowed=false" >>"$GITHUB_OUTPUT"
|
||||
echo "reason=outside_target_hour:${pt_hour}:${pt_minute}" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Skip if this PT release window already ran
|
||||
id: existing
|
||||
if: github.event_name == 'schedule' && steps.window.outputs.allowed == 'true'
|
||||
run: |
|
||||
# Why: scheduled runs retry inside each target hour, so make the
|
||||
# schedule idempotent by embedding a slot marker in the release commit.
|
||||
if git log origin/main --grep="\\[rc-slot:${{ steps.slot.outputs.value }}\\]" -n 1 --format=%H | grep -q .; then
|
||||
echo "already_ran=true" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Why: this preserves dedupe across the older scheduled workflow's
|
||||
# first runs, before all RC cuts shared release-cut's slot marker.
|
||||
latest_rc_tag="$(git for-each-ref --sort=-creatordate --format='%(refname:short) %(creatordate:iso-strict)' 'refs/tags/v*-rc.*' | head -n 1)"
|
||||
if [[ -n "$latest_rc_tag" ]]; then
|
||||
latest_rc_tag_name="${latest_rc_tag%% *}"
|
||||
latest_rc_tag_date="${latest_rc_tag#* }"
|
||||
latest_rc_slot="$(TZ=America/Los_Angeles date -d "$latest_rc_tag_date" '+%Y-%m-%d-%H')"
|
||||
|
||||
if [[ "$latest_rc_slot" == "${{ steps.slot.outputs.value }}" ]]; then
|
||||
echo "already_ran=true" >>"$GITHUB_OUTPUT"
|
||||
echo "reason=latest_rc_tag:$latest_rc_tag_name" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "already_ran=false" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Dry run summary
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.dry_run
|
||||
run: |
|
||||
echo "Dry run only."
|
||||
echo "Current PT slot: ${{ steps.slot.outputs.value }}"
|
||||
echo "Window allowed: ${{ steps.window.outputs.allowed }}"
|
||||
echo "Window reason: ${{ steps.window.outputs.reason }}"
|
||||
echo "Already ran this slot: ${{ steps.existing.outputs.already_ran }}"
|
||||
echo "Reason: ${{ steps.existing.outputs.reason }}"
|
||||
|
||||
- name: Skip summary
|
||||
if: steps.window.outputs.allowed != 'true' || steps.existing.outputs.already_ran == 'true'
|
||||
run: |
|
||||
echo "Skipping release cut."
|
||||
echo "Current PT slot: ${{ steps.slot.outputs.value }}"
|
||||
echo "Window reason: ${{ steps.window.outputs.reason }}"
|
||||
echo "Already ran this slot: ${{ steps.existing.outputs.already_ran }}"
|
||||
echo "Reason: ${{ steps.existing.outputs.reason }}"
|
||||
|
||||
- name: Compute next version
|
||||
id: version
|
||||
if: steps.window.outputs.allowed == 'true' && steps.existing.outputs.already_ran != 'true' && !(github.event_name == 'workflow_dispatch' && inputs.dry_run)
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
KIND: ${{ inputs.kind }}
|
||||
KIND: ${{ github.event_name == 'schedule' && 'rc' || inputs.kind }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
@@ -187,10 +278,53 @@ jobs:
|
||||
;;
|
||||
esac
|
||||
|
||||
# Refuse tag collisions (possible if someone already tagged manually).
|
||||
# Orphan-tag recovery.
|
||||
#
|
||||
# Why: if a previous cut pushed the tag but was cancelled (or the
|
||||
# dependent release.yml job otherwise failed to start) before the
|
||||
# GitHub Release was published, the tag now exists on the remote
|
||||
# but "latest stable" still points at the prior version. Every
|
||||
# subsequent patch cut then recomputes the same version and dies
|
||||
# on "Tag already exists." This exact sequence wedged the cut
|
||||
# pipeline on 2026-05-01 when v1.3.26 was pushed by a cancelled
|
||||
# run (25237882049) — every patch cut after that rehit the same
|
||||
# tag for hours until the orphan release was dispatched by hand.
|
||||
#
|
||||
# Recovery policy: if the tag exists AND no GitHub release has
|
||||
# been published for it (draft-or-absent both count as "not
|
||||
# shipped"), treat this as a resumable state: emit the existing
|
||||
# tag as the job output so the downstream release.yml job runs
|
||||
# against it and finishes what the earlier attempt started. The
|
||||
# bump/commit/push steps are skipped in that case — there is
|
||||
# nothing to bump; the tag is already on the remote.
|
||||
#
|
||||
# Refuse collisions only when the tag *and* a published release
|
||||
# already exist — that's a real conflict (someone tagged manually
|
||||
# over a shipped version) and needs human attention.
|
||||
if git rev-parse "v$new" >/dev/null 2>&1; then
|
||||
echo "::error::Tag v$new already exists." >&2
|
||||
exit 1
|
||||
# Use the REST API, not `gh release view`: the latter returns
|
||||
# "release not found" for drafts *and* for absent releases,
|
||||
# which would cause us to "recover" over a draft that a human
|
||||
# is preparing. The API distinguishes them.
|
||||
release_state="$(gh api \
|
||||
"repos/$GITHUB_REPOSITORY/releases/tags/v$new" \
|
||||
--jq '.draft' 2>/dev/null || echo "missing")"
|
||||
case "$release_state" in
|
||||
missing|true)
|
||||
echo "::warning::Tag v$new already exists but no published release is attached — recovering by re-dispatching release.yml against the existing tag."
|
||||
echo "recovered_tag=v$new" >>"$GITHUB_OUTPUT"
|
||||
echo "recovered=true" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
;;
|
||||
false)
|
||||
echo "::error::Tag v$new already exists and has a published release. Refusing to re-cut over a shipped version." >&2
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "::error::Unexpected release state for v$new: $release_state" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "version=$new" >>"$GITHUB_OUTPUT"
|
||||
@@ -198,7 +332,10 @@ jobs:
|
||||
|
||||
- name: Bump package.json and tag
|
||||
id: tag
|
||||
if: steps.version.outputs.version != '' && steps.version.outputs.recovered != 'true'
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
SLOT: ${{ steps.slot.outputs.value }}
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -207,12 +344,17 @@ jobs:
|
||||
# assumptions and any lifecycle scripts that would run on bump).
|
||||
npm version "$VERSION" --no-git-tag-version --allow-same-version
|
||||
git add package.json
|
||||
git commit -m "release: v$VERSION"
|
||||
commit_message="release: v$VERSION"
|
||||
if [[ "$EVENT_NAME" == "schedule" ]]; then
|
||||
commit_message="$commit_message [rc-slot:$SLOT]"
|
||||
fi
|
||||
git commit -m "$commit_message"
|
||||
git tag -a "v$VERSION" -m "v$VERSION"
|
||||
echo "tag=v$VERSION" >>"$GITHUB_OUTPUT"
|
||||
echo "sha=$(git rev-parse HEAD)" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Push tag
|
||||
if: steps.tag.outputs.tag != ''
|
||||
env:
|
||||
PUSH_MAIN: ${{ steps.resolve.outputs.push_main }}
|
||||
TAG: ${{ steps.tag.outputs.tag }}
|
||||
@@ -229,6 +371,7 @@ jobs:
|
||||
|
||||
release:
|
||||
needs: cut
|
||||
if: needs.cut.outputs.should_release == 'true'
|
||||
uses: ./.github/workflows/release.yml
|
||||
with:
|
||||
tag: ${{ needs.cut.outputs.tag }}
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
name: Schedule RC Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry_run:
|
||||
description: Validate the workflow without creating an RC version or tag
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
schedule:
|
||||
# Why: GitHub scheduled workflows are not guaranteed to start exactly on
|
||||
# time and can be delayed or dropped around high-load periods. We retry
|
||||
# across the full target hour and dedupe per PT slot.
|
||||
- cron: '*/5 3,15 * * *'
|
||||
timezone: 'America/Los_Angeles'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: release-rc
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
create-rc-tag:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
outputs:
|
||||
tag: ${{ steps.version.outputs.tag }}
|
||||
should_release: ${{ steps.window.outputs.allowed == 'true' && steps.existing.outputs.already_ran != 'true' && !(github.event_name == 'workflow_dispatch' && inputs.dry_run) }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
|
||||
- name: Configure git author
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Sync with latest main
|
||||
run: |
|
||||
git fetch origin main --tags
|
||||
git checkout main
|
||||
git reset --hard origin/main
|
||||
|
||||
- name: Compute RC slot
|
||||
id: slot
|
||||
run: |
|
||||
slot=$(TZ=America/Los_Angeles date '+%Y-%m-%d-%H')
|
||||
echo "value=$slot" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Validate PT release window
|
||||
id: window
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
run: |
|
||||
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
|
||||
echo "allowed=true" >>"$GITHUB_OUTPUT"
|
||||
echo "reason=manual" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pt_hour=$(TZ=America/Los_Angeles date '+%H')
|
||||
pt_minute=$(TZ=America/Los_Angeles date '+%M')
|
||||
|
||||
# Why: GitHub may deliver a scheduled event long after the intended
|
||||
# time. We only allow scheduled RC releases during the exact target
|
||||
# PT hours so a delayed run at 4:16 AM never creates a release that
|
||||
# was intended for 3:00 AM.
|
||||
if [[ "$pt_hour" == "03" || "$pt_hour" == "15" ]]; then
|
||||
echo "allowed=true" >>"$GITHUB_OUTPUT"
|
||||
echo "reason=target_hour:${pt_hour}:${pt_minute}" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "allowed=false" >>"$GITHUB_OUTPUT"
|
||||
echo "reason=outside_target_hour:${pt_hour}:${pt_minute}" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Skip if this PT release window already ran
|
||||
id: existing
|
||||
if: steps.window.outputs.allowed == 'true'
|
||||
run: |
|
||||
# Why: GitHub can delay or drop schedule events, especially near the
|
||||
# start of the hour. We schedule multiple attempts inside each target
|
||||
# PT hour and make the release idempotent per hour by embedding a
|
||||
# slot marker in the release commit message.
|
||||
if git log origin/main --grep="\\[rc-slot:${{ steps.slot.outputs.value }}\\]" -n 1 --format=%H | grep -q .; then
|
||||
echo "already_ran=true" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Why: the first scheduled run today used the earlier workflow before
|
||||
# slot markers existed. Keep a tag-time fallback so retries in the
|
||||
# same PT hour still skip if an RC tag was already created.
|
||||
latest_rc_tag="$(git for-each-ref --sort=-creatordate --format='%(refname:short) %(creatordate:iso-strict)' 'refs/tags/v*-rc.*' | head -n 1)"
|
||||
if [[ -n "$latest_rc_tag" ]]; then
|
||||
latest_rc_tag_name="${latest_rc_tag%% *}"
|
||||
latest_rc_tag_date="${latest_rc_tag#* }"
|
||||
latest_rc_slot="$(TZ=America/Los_Angeles date -d "$latest_rc_tag_date" '+%Y-%m-%d-%H')"
|
||||
|
||||
if [[ "$latest_rc_slot" == "${{ steps.slot.outputs.value }}" ]]; then
|
||||
echo "already_ran=true" >>"$GITHUB_OUTPUT"
|
||||
echo "reason=latest_rc_tag:$latest_rc_tag_name" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "already_ran=false" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Dry run summary
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.dry_run
|
||||
run: |
|
||||
echo "Dry run only."
|
||||
echo "Current PT slot: ${{ steps.slot.outputs.value }}"
|
||||
echo "Window allowed: ${{ steps.window.outputs.allowed }}"
|
||||
echo "Window reason: ${{ steps.window.outputs.reason }}"
|
||||
echo "Already ran this slot: ${{ steps.existing.outputs.already_ran }}"
|
||||
echo "Reason: ${{ steps.existing.outputs.reason }}"
|
||||
|
||||
- name: Skip summary
|
||||
if: steps.window.outputs.allowed != 'true'
|
||||
run: |
|
||||
echo "Skipping scheduled RC release."
|
||||
echo "Current PT slot: ${{ steps.slot.outputs.value }}"
|
||||
echo "Reason: ${{ steps.window.outputs.reason }}"
|
||||
|
||||
- name: Create and push RC tag
|
||||
id: version
|
||||
if: steps.window.outputs.allowed == 'true' && steps.existing.outputs.already_ran != 'true' && !(github.event_name == 'workflow_dispatch' && inputs.dry_run)
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Why: pushes made with GITHUB_TOKEN do not reliably trigger other
|
||||
# workflows via push events. The RC workflow invokes release.yml
|
||||
# directly after creating the tag, so the actual Electron release
|
||||
# runs inside this scheduled flow instead of depending on push.
|
||||
new_tag="$(npm version prerelease --preid=rc -m "release: %s [rc-slot:${{ steps.slot.outputs.value }}]")"
|
||||
git push origin main --follow-tags
|
||||
echo "tag=$new_tag" >>"$GITHUB_OUTPUT"
|
||||
|
||||
release-rc:
|
||||
needs: create-rc-tag
|
||||
if: needs.create-rc-tag.outputs.should_release == 'true'
|
||||
uses: ./.github/workflows/release.yml
|
||||
with:
|
||||
tag: ${{ needs.create-rc-tag.outputs.tag }}
|
||||
secrets: inherit
|
||||
@@ -245,3 +245,13 @@ jobs:
|
||||
--draft=false \
|
||||
--prerelease="$prerelease" \
|
||||
--repo "$GITHUB_REPOSITORY"
|
||||
|
||||
homebrew-bump:
|
||||
needs:
|
||||
- resolve-release
|
||||
- publish-release
|
||||
if: ${{ !contains(needs.resolve-release.outputs.tag, '-rc.') }}
|
||||
uses: ./.github/workflows/homebrew-bump.yml
|
||||
with:
|
||||
tag: ${{ needs.resolve-release.outputs.tag }}
|
||||
secrets: inherit
|
||||
|
||||
Reference in New Issue
Block a user