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
113 changes: 96 additions & 17 deletions .github/workflows/plusplus-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ jobs:
nightly_version: ${{ steps.resolve.outputs.nightly_version }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
sparse-checkout: .github/scripts

- id: resolve
name: Resolve release commit
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
DISPATCH_CHANNEL: ${{ inputs.channel }}
DISPATCH_VERSION: ${{ inputs.version }}
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
contents: read
steps:
- name: Require green required checks
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
RELEASE_REF: ${{ needs.resolve_commit.outputs.ref }}
with:
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
relay_url: ${{ steps.public_config.outputs.relay_url }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: ${{ needs.resolve_commit.outputs.ref }}
fetch-depth: 0
Expand Down Expand Up @@ -315,7 +315,7 @@ jobs:
# Share only the verification results, not the large registry metadata cache.
- name: Upload dependency verification
continue-on-error: true
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-dependency-verification
path: ${{ runner.temp }}/pnpm-metadata/lockfile-verified.jsonl
Expand All @@ -337,7 +337,7 @@ jobs:
T3CODE_RELAY_URL: ${{ needs.preflight.outputs.relay_url }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: ${{ needs.preflight.outputs.ref }}
sparse-checkout: |
Expand All @@ -349,7 +349,7 @@ jobs:
# artifact leaves the cache empty, so installation runs the checks again.
- name: Download dependency verification
continue-on-error: true
uses: actions/download-artifact@v8
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: release-dependency-verification
path: ${{ runner.temp }}/pnpm-metadata
Expand Down Expand Up @@ -392,7 +392,7 @@ jobs:
# Two paths under apps/ so the artifact root is apps/; consumers download
# into `apps` to restore both at their original locations.
- name: Upload JS bundle
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: js-bundle
path: |
Expand Down Expand Up @@ -504,7 +504,7 @@ jobs:
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: ${{ needs.preflight.outputs.ref }}
sparse-checkout: |
Expand All @@ -518,14 +518,14 @@ jobs:
install-args: --filter=@t3tools/scripts...

- name: Download all desktop artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: desktop-*
merge-multiple: true
path: release-assets

- name: Download all CLI archives
uses: actions/download-artifact@v8
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: cli-*
merge-multiple: true
Expand Down Expand Up @@ -569,7 +569,7 @@ jobs:
cat SHA256SUMS

- name: Attest build provenance
uses: actions/attest-build-provenance@v4
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: |
release-assets/*.exe
Expand Down Expand Up @@ -608,14 +608,24 @@ jobs:

# electron-updater reads one manifest per platform and channel. Only the
# x64 Windows build ships, so its per-arch manifest becomes the one file.
- name: Merge Windows updater manifests
# Upstream's merge-release-update-manifests.ts requires arm64/x64 pairs
# the fork never builds, so this requires the fork's own two feeds
# instead: a release that published without one would strand that
# platform's installs, and `*.yml` below still matches the other.
- name: Require Windows and Linux updater manifests
if: needs.preflight.outputs.release_channel != 'preview'
shell: bash
env:
FEED: ${{ needs.preflight.outputs.release_channel == 'nightly' && 'nightly' || 'latest' }}
run: |
shopt -s nullglob
for x64_manifest in release-assets/*-win-x64.yml; do
merged_manifest="${x64_manifest%-win-x64.yml}.yml"
mv "$x64_manifest" "$merged_manifest"
set -euo pipefail
for manifest in "release-assets/$FEED-win-x64.yml" "release-assets/$FEED-linux.yml"; do
if [[ ! -f "$manifest" ]]; then
echo "::error::Missing updater manifest $manifest."
exit 1
fi
done
mv "release-assets/$FEED-win-x64.yml" "release-assets/$FEED.yml"

# Updater manifests and blockmaps are what electron-updater consumes.
# They are only listed for channels an updater is meant to follow.
Expand Down Expand Up @@ -702,3 +712,72 @@ jobs:
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
run: gh release edit "$RELEASE_TAG" --draft=false

# A nightly install finds updates in releases.atom, which holds the 10 newest git tags of any
# kind, so a burst of preview or stable tags can hide every nightly. The `update-feed` release
# is the fixed URL ++ builds also read. Every nightly dispatch repairs it, then fails when the
# feed's first nightly is not the newest one. See plusplus/docs/release.md#update-feed.
update_feed:
name: Check the update feed
needs: [preflight, release, verify_ci]
if: ${{ !cancelled() && needs.preflight.outputs.release_channel == 'nightly' }}
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
sparse-checkout: .github/scripts

- id: feed
name: Read the update feed
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
retries: 3
script: |
const { readNightlyUpdateFeed } = require('./.github/scripts/check-nightly-release.cjs');
const { tag, pointerTag, feedNightly, feedTags } = await readNightlyUpdateFeed({ github, context });
if (!tag) return;
core.info(`Newest nightly: ${tag}. Pointer: ${pointerTag}. Feed: ${feedTags?.join(', ')}.`);
core.setOutput('tag', tag);
core.setOutput('pointer_stale', pointerTag !== tag);
core.setOutput('feed', feedTags === undefined ? 'unreadable' : feedNightly === tag ? 'ok' : 'hidden');

- name: Point the update feed at the newest nightly
if: steps.feed.outputs.pointer_stale == 'true'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ steps.feed.outputs.tag }}
run: |
gh api "repos/$GH_REPO/releases/tags/$RELEASE_TAG" --jq '{tag_name, name, body}' > nightly.json
gh release view update-feed > /dev/null 2>&1 ||
gh release create update-feed --prerelease --latest=false --title "Update feed" \
--notes "The desktop updater reads this release to find the newest nightly. Do not delete it. See plusplus/docs/release.md."
gh release upload update-feed nightly.json --clobber

# Every run, because the pointer can be current while the release's flags are wrong. A draft's
# files are not public, and a release marked "latest" is the one stable installs update to.
- name: Keep the update feed release public and never latest
if: steps.feed.outputs.tag != ''
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release edit update-feed --draft=false --prerelease --latest=false

# An unreadable feed says nothing about its tags and the next nightly reads it again, so only
# a feed that was read and names another nightly first fails the run.
- name: Fail when the feed hides the newest nightly
if: steps.feed.outputs.tag != '' && steps.feed.outputs.feed != 'ok'
env:
RELEASE_TAG: ${{ steps.feed.outputs.tag }}
FEED: ${{ steps.feed.outputs.feed }}
run: |
if [[ "$FEED" == "unreadable" ]]; then
echo "::warning::releases.atom could not be read, so this run did not check it."
exit 0
fi
echo "::error::The first nightly in releases.atom is not $RELEASE_TAG. ++ builds without the update-feed pointer cannot reach it. A preview tag left behind is the usual cause. See plusplus/docs/release.md#update-feed."
exit 1
27 changes: 24 additions & 3 deletions plusplus/docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ than a fork-only version bump.
gate, and a failed required check cannot block a preview, only a stable or nightly dispatch.
6. **Publish GitHub Release.** Writes `SHA256SUMS` from the archives it uploads, refuses updater
metadata on preview releases, drops any macOS updater files (`*-mac.yml`, the updater app zip,
the DMG blockmap) that no install is meant to follow, merges the per-arch Windows updater manifest
back into `latest.yml` or `nightly.yml`, and attaches every asset. A prerelease stays a draft
until all assets are attached.
the DMG blockmap) that no install is meant to follow, requires the channel's Windows and Linux
updater manifests, renames the per-arch Windows one back into `latest.yml` or `nightly.yml`, and
attaches every asset. A prerelease stays a draft until all assets are attached.
7. **Check the update feed.** Nightly only: repoints the `update-feed` release at the newest nightly
(see [Update feed](#update-feed)).

The release workflow builds no test matrix of its own; on stable and nightly the required checks are
the gate. Dispatch a stable or nightly only once they are green on the commit you intend to ship.
Expand Down Expand Up @@ -204,6 +206,22 @@ a dry run.
receive it.
- It commits nothing back to `main`. Retention for nightlies is in [Retention](#retention).

## Update feed

A nightly install finds the newest nightly in `releases.atom`, which lists the 10 newest git tags of
any kind, and takes its first nightly. Preview and stable tags can sort above it, so ++ builds also
read `releases/download/update-feed/nightly.json`, which names the newest nightly, and take the newer
of the two. The `update-feed` prerelease holds that file and is never marked latest. Never delete it.

Every nightly dispatch ends with **Check the update feed**, which rewrites a missing or outdated
pointer and fails when the first nightly in the feed is not the newest one. The release is already
public by then; the failure means installs that read only the feed cannot reach it. Delete the
preview tags nothing needs with `git push origin :refs/tags/<tag>`.

To pull a bad nightly, delete its release and tag, then run
`gh release delete-asset update-feed nightly.json`. Installs fall back to the feed until the next
nightly rewrites the pointer.

## Preview release

Preview is the maintainers' test train. It runs the whole pipeline (bundle, all three desktop jobs,
Expand Down Expand Up @@ -450,6 +468,9 @@ sidecar layout change costs one larger download and later releases keep small bl
revision; do not delete the release or move the tag to force the old version through.
- **`Preview releases must not carry updater metadata`** The packaging step emitted a feed for a
preview version. Fix the publish-config condition; do not drop the guard.
- **`Missing updater manifest release-assets/...`** A desktop job succeeded without emitting its
channel's feed. Publishing would strand that platform's installs; fix the publish config.
- **`The first nightly in releases.atom is not ...`** See [Update feed](#update-feed).
- **Windows verify job fails** The packaged natives, CLI archive, or resource monitor would not run
for users. Treat the build as broken and fix it before publishing again.
- **Linux AppImage launch check fails** The shipped backend or bundle cannot start. The database
Expand Down
Loading