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
89 changes: 89 additions & 0 deletions .github/workflows/accesscode-windows-payloads.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build unsigned AccessCode Windows release payloads

on:
workflow_dispatch:
inputs:
version:
description: Stable version from package.json (for example, 2.3.2)
required: true
type: string

publisher:
description: Exact Authenticode subject for the manually signed Windows update
required: true
type: string

permissions:
contents: read

concurrency:
group: accesscode-windows-release-${{ inputs.version }}
cancel-in-progress: false

jobs:
build-app:
if: github.ref == 'refs/heads/main'
runs-on: windows-2025
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- desktop: windows-x64
cli: windows-x64-baseline
install: ""
- desktop: windows-arm64
cli: windows-arm64
install: --cpu=*
env:
OPENCODE_CHANNEL: latest
OPENCODE_VERSION: ${{ inputs.version }}
ACCESSCODE_WINDOWS_UPDATE_PUBLISHER: ${{ inputs.publisher }}
CSC_IDENTITY_AUTO_DISCOVERY: "false"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/setup-bun
with:
install-flags: ${{ matrix.install }}
- name: Validate stable version and publisher
shell: pwsh
run: |
$version = $env:OPENCODE_VERSION
$manifestVersion = (Get-Content package.json -Raw | ConvertFrom-Json).version
if ($version -notmatch '^\d+\.\d+\.\d+$' -or $version -ne $manifestVersion) {
throw "Release candidate version must be the stable package.json version ($manifestVersion)."
}
if ([string]::IsNullOrWhiteSpace($env:ACCESSCODE_WINDOWS_UPDATE_PUBLISHER)) {
throw "Enter the approved Authenticode subject as the publisher input."
}
- name: Build bundled CLI
run: bun run --cwd packages/cli build --skip-install
env:
OPENCODE_TARGET: ${{ matrix.cli }}
- name: Build desktop
run: bun run --cwd packages/desktop build
env:
OPENCODE_TARGET: ${{ matrix.desktop }}
- name: Pack unpacked app
run: bun run --cwd packages/desktop pack
env:
OPENCODE_TARGET: ${{ matrix.desktop }}
- name: Stage app and pack portable edition
shell: pwsh
env:
OPENCODE_TARGET: ${{ matrix.desktop }}
run: |
Move-Item dist\desktop\app (Join-Path $env:RUNNER_TEMP 'app')
bun run --cwd packages\desktop pack --portable
if ($LASTEXITCODE) { exit $LASTEXITCODE }
Move-Item "dist\portable\AccessCode-$env:OPENCODE_TARGET" (Join-Path $env:RUNNER_TEMP 'portable')
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: unsigned-stable-app-${{ matrix.desktop }}
path: ${{ runner.temp }}/app
if-no-files-found: error
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: unsigned-stable-portable-${{ matrix.desktop }}
path: ${{ runner.temp }}/portable
if-no-files-found: error
10 changes: 9 additions & 1 deletion .github/workflows/accesscode-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,19 @@ jobs:
if ($LASTEXITCODE) { exit $LASTEXITCODE }
$env:ISCC = Join-Path ${env:ProgramFiles(x86)} 'Inno Setup 6\ISCC.exe'
Move-Item dist\desktop\app $env:RUNNER_TEMP
bun run --cwd packages\desktop pack --portable
if ($LASTEXITCODE) { exit $LASTEXITCODE }
Move-Item "dist\portable\AccessCode-$env:OPENCODE_TARGET" (Join-Path $env:RUNNER_TEMP 'portable')
$env:OPENCODE_DESKTOP_APP = Join-Path $env:RUNNER_TEMP 'app'
bun run --cwd packages\desktop pack
if ($LASTEXITCODE) { exit $LASTEXITCODE }
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: accesscode-${{ matrix.desktop }}
name: accesscode-installer-${{ matrix.desktop }}
path: dist/desktop/*.exe
if-no-files-found: error
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: accesscode-portable-${{ matrix.desktop }}
path: ${{ runner.temp }}/portable
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
docs:
name: docs build
if: ${{ !github.event.pull_request.draft }}
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ${{ github.repository == 'Community-Access/access-code' && 'ubuntu-24.04' || 'blacksmith-4vcpu-ubuntu-2404' }}
timeout-minutes: 10
defaults:
run:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/check-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ jobs:
matrix:
# Pull requests run Linux only; Windows runs the same tests on pushes, nightly runs and the release gate.
settings: ${{ fromJSON(github.event_name == 'pull_request' && '[{"name":"linux","host":"blacksmith-4vcpu-ubuntu-2404"}]' || '[{"name":"linux","host":"blacksmith-4vcpu-ubuntu-2404"},{"name":"windows","host":"blacksmith-4vcpu-windows-2025"}]') }}
runs-on: ${{ matrix.settings.host }}
# Access Code uses GitHub-hosted Linux runners for its pull requests.
runs-on: ${{ github.repository == 'Community-Access/access-code' && github.event_name == 'pull_request' && 'ubuntu-24.04' || matrix.settings.host }}
defaults:
run:
shell: bash
Expand Down Expand Up @@ -118,6 +119,10 @@ jobs:
git config --global user.email "bot@opencode.ai"
git config --global user.name "opencode"

- name: Install ripgrep for offline search tests
if: runner.os == 'Linux' && github.repository == 'Community-Access/access-code' && github.event_name == 'pull_request'
run: sudo apt-get update -qq && sudo apt-get install -y ripgrep

- name: Run unit tests
timeout-minutes: 20
run: |
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/custom-elements.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/app/src/custom-elements.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference path="../../ui/src/custom-elements.d.ts" />
24 changes: 23 additions & 1 deletion packages/client/test/promise.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,20 @@ test("exposes every standard HTTP API group", () => {
expect(Object.keys(client.websearch)).toEqual(["providers", "query"])
expect(Object.keys(client.file)).toEqual(["read", "list", "find", "write", "watch", "unwatch"])
expect(Object.keys(client.mcp)).toEqual(["list", "resource", "add", "remove", "connect", "disconnect", "client"])
expect(Object.keys(client.config)).toEqual(["get", "shells", "update"])
expect(Object.keys(client.config)).toEqual([
"get",
"shells",
"update",
"mcpRegistry",
"mcpPopular",
"mcpDocker",
"skillSearch",
"skillInstall",
"skillRemove",
"extensionPaths",
"mcpSignIn",
"tools",
])
expect(Object.keys(client.vcs)).toEqual(["init", "get", "base", "status", "branch", "diff"])
expect(Object.keys(client.pty)).toEqual(["list", "create", "get", "update", "remove", "connect"])
expect(Object.keys(client.pty.connect)).toEqual(["token"])
Expand Down Expand Up @@ -143,6 +156,15 @@ test("nests a method under client.experimental exactly when its route is experim
).toEqual([])
// Pre-experimental paths kept as deprecated aliases until the next minor.
expect(deprecated.toSorted()).toEqual([
"config.extensionPaths",
"config.mcpDocker",
"config.mcpPopular",
"config.mcpRegistry",
"config.mcpSignIn",
"config.skillInstall",
"config.skillRemove",
"config.skillSearch",
"config.tools",
"config.update",
"file.unwatch",
"file.watch",
Expand Down
27 changes: 19 additions & 8 deletions packages/desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bun dev

`bun run build` prepares `resources/` (icons, metainfo and the bundled CLI) and builds the app into `out/`.
`bun run pack` then packages it, unsigned, into `dist/desktop/` at the repository root: a `.app` tarball on macOS,
the unpacked app on Windows, and AppImage/deb/rpm on Linux. The release workflow signs and notarizes afterwards.
the unpacked app on Windows, and AppImage/deb/rpm on Linux. Mac release builds are signed and notarized in CI. Windows releases are signed manually.

```bash
bun run build && bun run pack
Expand Down Expand Up @@ -72,13 +72,24 @@ try {
The resulting installer is `dist\desktop\accesscode-desktop-win-x64.exe`. The temporary staged copy can be
removed after packaging. This procedure does not sign or publish the installer.

For an update-enabled production release, use `OPENCODE_CHANNEL=latest` and set
`ACCESSCODE_WINDOWS_UPDATE_PUBLISHER` to the exact Authenticode signer subject before packing the unpacked app.
Build x64 and ARM64, sign their unpacked payloads, then compile and sign both final Inno installers. From the
repository root in PowerShell 7, run `.github\release\write-accesscode-windows-feed.ps1` with the installer
directory, stable version and signing subject. Publish the two signed installers and `latest.yml` together as
assets of the latest [AccessCode GitHub release](https://github.com/Community-Access/access-code/releases). Do not
publish unsigned installers to this feed. Automatic updates are off in local and preview builds.
The [Windows CI workflow](../../.github/workflows/accesscode-windows.yml) builds unsigned Dev installers and
portable editions for x64 and ARM64. These are for testing, not public release.

For a stable Windows release, run the [unsigned payload build](../../.github/workflows/accesscode-windows-payloads.yml)
from `main`. Enter the stable version from `package.json` and the exact Authenticode publisher subject agreed with
the maintainer. The workflow builds x64 and ARM64 and uploads an unpacked app and a portable folder for each.

On the signing machine, check out the same commit and download the four unsigned stable payloads. For each
architecture, manually sign the release-owned binaries in both folders and verify their signatures and publisher.
Preserve and verify the expected third-party signatures. Archive the signed portable folder with its marker intact.
Set `OPENCODE_CHANNEL=latest`, the matching `OPENCODE_VERSION` and `OPENCODE_TARGET`, and point `OPENCODE_DESKTOP_APP`
at the signed unpacked app. Run the Inno packaging command above, then sign and verify the resulting installer.
Stage each installer outside `dist/desktop` before packing the next architecture, since packing clears that directory.

To publish automatic updates, run `.github\release\write-accesscode-windows-feed.ps1` with the signed installer
directory, stable version and signing subject. Publish both signed installers and the generated `latest.yml`
together as assets of the latest [AccessCode GitHub release](https://github.com/Community-Access/access-code/releases).
Do not publish unsigned installers to this feed. Automatic updates are off in local and preview builds.

#### Sign Windows builds with Azure Artifact Signing

Expand Down
Loading
Loading