Skip to content

Commit 1cacc37

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-26863
2 parents 66434ee + 48247dd commit 1cacc37

57 files changed

Lines changed: 3080 additions & 174 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/release-desktop.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,15 @@ jobs:
390390
mkdir -p "$target_dir"
391391
cp "native/resource-monitor/target/${{ inputs.rust_target }}/release/${binary_name}" "$target_dir/$binary_name"
392392
393+
- uses: ./.github/actions/setup-apt-mirrors
394+
if: inputs.platform == 'linux'
395+
396+
# The Linux archive ships libatomic.so.1 and points t3's RUNPATH at it.
397+
- name: Install patchelf
398+
if: inputs.cli_archive && inputs.platform == 'linux'
399+
shell: bash
400+
run: command -v patchelf || { sudo apt-get update && sudo apt-get install -y patchelf; }
401+
393402
- name: Build CLI archive
394403
if: inputs.cli_archive
395404
shell: bash
@@ -433,9 +442,6 @@ jobs:
433442
path: release-cli/*
434443
if-no-files-found: error
435444

436-
- uses: ./.github/actions/setup-apt-mirrors
437-
if: inputs.platform == 'linux'
438-
439445
- name: Install Linux desktop build libraries
440446
if: inputs.platform == 'linux'
441447
shell: bash

‎.github/workflows/release.yml‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,16 @@ jobs:
762762
timeout-minutes: 30
763763
permissions:
764764
contents: write
765+
# Release notes read PR bodies and authors.
766+
pull-requests: read
765767
steps:
766768
- name: Checkout
767769
uses: actions/checkout@v6
768770
with:
769771
ref: ${{ needs.preflight.outputs.ref }}
772+
# Release notes need history back to the previous tag, not file contents.
773+
fetch-depth: 0
774+
filter: blob:none
770775
sparse-checkout: |
771776
/*
772777
!/.repos/
@@ -892,6 +897,27 @@ jobs:
892897
echo 'EOF'
893898
} >> "$GITHUB_OUTPUT"
894899
900+
# A short model summary over GitHub's full list. Without a notes file, the
901+
# release falls back to GitHub's generated notes.
902+
- name: Write release notes
903+
if: needs.preflight.outputs.release_channel != 'preview' && needs.preflight.outputs.previous_tag != ''
904+
continue-on-error: true
905+
timeout-minutes: 5
906+
env:
907+
GH_TOKEN: ${{ github.token }}
908+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
909+
run: |
910+
node scripts/generate-release-notes.ts \
911+
--repository "${{ github.repository }}" \
912+
--tag "${{ needs.preflight.outputs.tag }}" \
913+
--ref "${{ needs.preflight.outputs.ref }}" \
914+
--previous-tag "${{ needs.preflight.outputs.previous_tag }}" \
915+
--version "${{ needs.preflight.outputs.version }}" \
916+
--output release-notes.md
917+
if [[ -f release-notes.md ]]; then
918+
cat release-notes.md >> "$GITHUB_STEP_SUMMARY"
919+
fi
920+
895921
# A preview release gets a warning instead of generated notes. Generated
896922
# notes would list every commit since the previous preview, which is
897923
# unmerged branch history no one should read as a changelog, and would
@@ -917,8 +943,8 @@ jobs:
917943
tag_name: ${{ needs.preflight.outputs.tag }}
918944
target_commitish: ${{ needs.preflight.outputs.ref }}
919945
name: ${{ needs.preflight.outputs.release_name }}
920-
generate_release_notes: ${{ needs.preflight.outputs.release_channel != 'preview' }}
921-
body_path: ${{ needs.preflight.outputs.release_channel == 'preview' && 'release-notes.md' || '' }}
946+
generate_release_notes: ${{ hashFiles('release-notes.md') == '' }}
947+
body_path: ${{ hashFiles('release-notes.md') != '' && 'release-notes.md' || '' }}
922948
previous_tag: ${{ needs.preflight.outputs.previous_tag }}
923949
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
924950
make_latest: ${{ needs.preflight.outputs.make_latest }}

‎apps/desktop/src/ipc/methods/updates.ts‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ export const getUpdateState = DesktopIpc.makeIpcMethod({
2323

2424
export const setUpdateChannel = DesktopIpc.makeIpcMethod({
2525
channel: IpcChannels.UPDATE_SET_CHANNEL_CHANNEL,
26-
payload: DesktopUpdateChannelSchema,
26+
payload: Schema.Struct({
27+
channel: DesktopUpdateChannelSchema,
28+
minimumVersion: Schema.optional(Schema.String),
29+
}),
2730
result: DesktopUpdateStateSchema,
28-
handler: Effect.fn("desktop.ipc.updates.setChannel")(function* (channel) {
31+
handler: Effect.fn("desktop.ipc.updates.setChannel")(function* ({ channel, minimumVersion }) {
2932
const updates = yield* DesktopUpdates.DesktopUpdates;
30-
return yield* updates.setChannel(channel);
33+
return yield* updates.setChannel(channel, { minimumVersion });
3134
}),
3235
});
3336

@@ -43,11 +46,14 @@ export const downloadUpdate = DesktopIpc.makeIpcMethod({
4346

4447
export const installUpdate = DesktopIpc.makeIpcMethod({
4548
channel: IpcChannels.UPDATE_INSTALL_CHANNEL,
46-
payload: Schema.Void,
49+
/** A version installs only that downloaded build, never one that replaced it. */
50+
payload: Schema.UndefinedOr(Schema.String),
4751
result: DesktopUpdateActionResultSchema,
48-
handler: Effect.fn("desktop.ipc.updates.install")(function* () {
52+
handler: Effect.fn("desktop.ipc.updates.install")(function* (expectedVersion) {
4953
const updates = yield* DesktopUpdates.DesktopUpdates;
50-
return yield* updates.install;
54+
if (expectedVersion === undefined) return yield* updates.install;
55+
const { accepted, completed, state } = yield* updates.installPrepared(expectedVersion);
56+
return { accepted, completed, state };
5157
}),
5258
});
5359

‎apps/desktop/src/preload.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,12 @@ contextBridge.exposeInMainWorld("desktopBridge", {
261261
};
262262
},
263263
getUpdateState: () => ipcRenderer.invoke(IpcChannels.UPDATE_GET_STATE_CHANNEL),
264-
setUpdateChannel: (channel) =>
265-
ipcRenderer.invoke(IpcChannels.UPDATE_SET_CHANNEL_CHANNEL, channel),
264+
setUpdateChannel: (channel, minimumVersion) =>
265+
ipcRenderer.invoke(IpcChannels.UPDATE_SET_CHANNEL_CHANNEL, { channel, minimumVersion }),
266266
checkForUpdate: () => ipcRenderer.invoke(IpcChannels.UPDATE_CHECK_CHANNEL),
267267
downloadUpdate: () => ipcRenderer.invoke(IpcChannels.UPDATE_DOWNLOAD_CHANNEL),
268-
installUpdate: () => ipcRenderer.invoke(IpcChannels.UPDATE_INSTALL_CHANNEL),
268+
installUpdate: (expectedVersion) =>
269+
ipcRenderer.invoke(IpcChannels.UPDATE_INSTALL_CHANNEL, expectedVersion),
269270
cliCommand: {
270271
getState: () => ipcRenderer.invoke(IpcChannels.CLI_COMMAND_GET_STATE_CHANNEL),
271272
install: () => ipcRenderer.invoke(IpcChannels.CLI_COMMAND_INSTALL_CHANNEL),

‎apps/desktop/src/settings/DesktopAppSettings.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
normalizeLinuxPasswordStorePreference,
2323
type LinuxPasswordStorePreference,
2424
} from "../linuxSecretStorage.ts";
25-
import { resolveDefaultDesktopUpdateChannel } from "../updates/updateChannels.ts";
25+
import { desktopUpdateChannelOf } from "@t3tools/shared/cliRelease";
2626
import { isValidDistroName } from "../wsl/wslPathParsing.ts";
2727

2828
export interface DesktopSettings {
@@ -180,7 +180,7 @@ export class DesktopAppSettings extends Context.Service<
180180
export function resolveDefaultDesktopSettings(appVersion: string): DesktopSettings {
181181
return {
182182
...DEFAULT_DESKTOP_SETTINGS,
183-
updateChannel: resolveDefaultDesktopUpdateChannel(appVersion),
183+
updateChannel: desktopUpdateChannelOf(appVersion),
184184
};
185185
}
186186

0 commit comments

Comments
 (0)