Skip to content

Commit 69f60d4

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/debounce
# Conflicts: # packages/lint-framework/src/lint/LintFramework.ts
2 parents 2d9782f + 8e5c73f commit 69f60d4

372 files changed

Lines changed: 14355 additions & 3076 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.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#!/usr/bin/env bash
2+
# Buildkite step: build, sign, and notarize harper-desktop.
3+
# See .buildkite/pipeline.yml.
4+
5+
set -euo pipefail
6+
7+
echo "--- :rubygems: Install gems"
8+
install_gems
9+
10+
echo "--- :rust: Install Rust toolchain"
11+
# A8C Mac VMs have no Rust tooling baked in. Install `rustup` non-interactively,
12+
# then add the targets we need.
13+
# `--no-modify-path` is intentional: we source `cargo/env` ourselves below so
14+
# nothing outside this build step picks up cargo on a shared agent.
15+
if ! command -v rustup >/dev/null 2>&1; then
16+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
17+
| sh -s -- -y --no-modify-path --default-toolchain stable --profile minimal
18+
fi
19+
# shellcheck disable=SC1091
20+
. "$HOME/.cargo/env"
21+
22+
# Universal builds (master, tags) need both arches. PR/branch builds run
23+
# Apple-Silicon-only to skip the x86_64 half of the compile (~4m saved).
24+
if [ "${BUILDKITE_BRANCH:-}" = "master" ] || [ -n "${BUILDKITE_TAG:-}" ]; then
25+
TAURI_TARGET=universal-apple-darwin
26+
JUST_RECIPE=build-desktop-macos
27+
rustup target add aarch64-apple-darwin x86_64-apple-darwin wasm32-unknown-unknown
28+
else
29+
TAURI_TARGET=aarch64-apple-darwin
30+
JUST_RECIPE=build-desktop-macos-arm64
31+
rustup target add aarch64-apple-darwin wasm32-unknown-unknown
32+
fi
33+
echo "Build target: $TAURI_TARGET (recipe: $JUST_RECIPE)"
34+
35+
echo "--- :floppy_disk: Restore cargo caches"
36+
# Two cache layers, both keyed off Cargo.lock + rust-toolchain.toml so they
37+
# invalidate the moment any dep version moves.
38+
# 1. `~/.cargo/registry` + `~/.cargo/git/db` — downloaded crate sources / git
39+
# deps. ~340MB compressed. Saves the crate-download phase on cold builds.
40+
# 2. `target/` — compiled artifacts. Several GB compressed. Lets cargo's
41+
# incremental compilation reuse object files across builds. The target
42+
# cache also includes the Tauri target arch in its key, since universal
43+
# and arm64-only builds produce disjoint object trees.
44+
CARGO_DEPS_KEY="$BUILDKITE_PIPELINE_SLUG-cargo-deps-darwin-arm64-$(hash_file Cargo.lock)-$(hash_file rust-toolchain.toml)"
45+
CARGO_TARGET_KEY="$BUILDKITE_PIPELINE_SLUG-target-darwin-arm64-$TAURI_TARGET-$(hash_file Cargo.lock)-$(hash_file rust-toolchain.toml)"
46+
restore_cache "$CARGO_DEPS_KEY"
47+
restore_cache "$CARGO_TARGET_KEY"
48+
49+
echo "--- :package: Install build tools"
50+
# Without Rust pre-baked there's no `cargo-binstall` either. Use cargo-binstall's
51+
# own curl installer to pull a prebuilt — about a second, vs ~1m15s of `cargo
52+
# install --locked` building it from source.
53+
if ! command -v cargo-binstall >/dev/null 2>&1; then
54+
curl -L --proto '=https' --tlsv1.2 -sSf \
55+
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh \
56+
| bash
57+
fi
58+
cargo binstall --no-confirm --force just
59+
cargo binstall --no-confirm --force wasm-pack
60+
# Skip cargo-binstall'ing `tauri-cli` — Tauri doesn't publish GitHub release
61+
# prebuilts for the CLI, so binstall always falls back to a source compile
62+
# (~2 minutes). `@tauri-apps/cli` from npm is the same Rust binary distributed
63+
# via platform-specific subpackages — it's already a devDependency of
64+
# `harper-desktop/package.json`, so `pnpm install` in that directory will pick
65+
# it up. The justfile recipes invoke it as `pnpm tauri build` rather than
66+
# `cargo tauri build`.
67+
68+
echo "--- :npm: Install pnpm"
69+
# Node is set up by the `automattic/nvm` Buildkite plugin from `.nvmrc`.
70+
# `pnpm` is not bundled — install it via `npm install -g`. Pin matches the
71+
# `packageManager` field in the root `package.json`.
72+
npm install -g pnpm@10.10.0
73+
hash -r
74+
75+
echo "--- :key: Fetch Developer ID certificate"
76+
bundle exec fastlane set_up_signing
77+
78+
echo "--- :hammer: Build harper-desktop (signed)"
79+
# `just $JUST_RECIPE` runs `pnpm tauri build -b app,dmg --target $TAURI_TARGET`
80+
# in `harper-desktop/`. With `APPLE_SIGNING_IDENTITY` set, Tauri's bundler signs
81+
# the produced .app and .dmg. `TAURI_SIGNING_PRIVATE_KEY` enables the minisign
82+
# updater signing.
83+
export APPLE_SIGNING_IDENTITY="Developer ID Application: Automattic, Inc. (PZYM8XX95Q)"
84+
just "$JUST_RECIPE"
85+
86+
echo "--- :floppy_disk: Save cargo caches"
87+
# `save_cache` is a no-op when the key already exists in S3, so this is cheap on
88+
# subsequent same-deps builds. Runs after the build (so what gets cached is
89+
# coherent) but before notarization (a flaky notary shouldn't lose us the
90+
# cache). The target/ save is the one to watch — several GB of upload on a cold
91+
# key.
92+
save_cache "$HOME/.cargo/registry" "$CARGO_DEPS_KEY"
93+
save_cache "$HOME/.cargo/git/db" "$CARGO_DEPS_KEY-git" || true
94+
save_cache target "$CARGO_TARGET_KEY"
95+
96+
echo "--- :apple: Notarize and staple"
97+
# Tauri signs but does not notarize when only APPLE_SIGNING_IDENTITY is set.
98+
# Notarize the .app and .dmg ourselves so Gatekeeper accepts them with no warning.
99+
APP_BUNDLE=$(find "target/$TAURI_TARGET/release/bundle/macos" -maxdepth 1 -name '*.app' -type d | head -1)
100+
DMG_FILE=$(find "target/$TAURI_TARGET/release/bundle/dmg" -maxdepth 1 -name '*.dmg' -type f | head -1)
101+
102+
[ -n "$APP_BUNDLE" ] || { echo "no .app produced"; exit 1; }
103+
[ -n "$DMG_FILE" ] || { echo "no .dmg produced"; exit 1; }
104+
105+
bundle exec fastlane notarize_macos package:"$APP_BUNDLE"
106+
bundle exec fastlane notarize_macos package:"$DMG_FILE"
107+
108+
if [ -n "${BUILDKITE_TAG:-}" ]; then
109+
echo "--- :rocket: Publish draft GitHub release"
110+
APP_TARBALL=$(find "target/$TAURI_TARGET/release/bundle/macos" -maxdepth 1 -name '*.app.tar.gz' -type f | head -1)
111+
APP_SIG=$(find "target/$TAURI_TARGET/release/bundle/macos" -maxdepth 1 -name '*.app.tar.gz.sig' -type f | head -1)
112+
[ -n "$APP_TARBALL" ] || { echo "no .app.tar.gz produced"; exit 1; }
113+
[ -n "$APP_SIG" ] || { echo "no .app.tar.gz.sig produced"; exit 1; }
114+
bundle exec fastlane create_desktop_github_release \
115+
tag:"$BUILDKITE_TAG" \
116+
dmg:"$DMG_FILE" \
117+
app_tarball:"$APP_TARBALL" \
118+
app_signature:"$APP_SIG"
119+
fi

.buildkite/pipeline.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
2+
---
3+
4+
agents:
5+
queue: mac
6+
7+
env:
8+
IMAGE_ID: $IMAGE_ID
9+
10+
steps:
11+
- label: ":tauri: Build, sign, notarize harper-desktop"
12+
key: build-desktop
13+
command: .buildkite/commands/build-desktop.sh
14+
plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN]
15+
artifact_paths:
16+
# Branch/PR builds produce `aarch64-apple-darwin` artifacts; master and
17+
# tag builds produce `universal-apple-darwin`. Glob both.
18+
- target/*-apple-darwin/release/bundle/dmg/*.dmg
19+
- target/*-apple-darwin/release/bundle/macos/*.app.tar.gz
20+
- target/*-apple-darwin/release/bundle/macos/*.app.tar.gz.sig
21+
notify:
22+
- github_commit_status:
23+
context: "Build, sign, notarize harper-desktop"

.buildkite/shared-pipeline-vars

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used
4+
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.
5+
6+
XCODE_VERSION=$(sed -E 's/^~> ?//' .xcode-version)
7+
CI_TOOLKIT_PLUGIN_VERSION="6.1.0"
8+
NVM_PLUGIN_VERSION="0.6.0"
9+
10+
export IMAGE_ID="xcode-$XCODE_VERSION"
11+
export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION"
12+
export NVM_PLUGIN="automattic/nvm#$NVM_PLUGIN_VERSION"

.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
BUNDLE_PATH: "vendor/bundle"

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Platform**
27-
What platform has the issue? Is it in Obsidian, Neovim, Visual Studio Code, Chrome, or Firefox? Something else?
27+
What platform has the issue? Is it in Obsidian, Chrome or Firefox, Visual Studio Code, the Desktop app, Neovim, or something else?
2828

2929
**Additional context**
3030
Add any other context about the problem here.

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,24 @@ updates:
88
directory: "/"
99
schedule:
1010
interval: "weekly"
11+
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
day: "monday"
17+
open-pull-requests-limit: 10
18+
groups:
19+
actions-minor-patch:
20+
patterns:
21+
- "*"
22+
update-types:
23+
- "minor"
24+
- "patch"
25+
actions-major:
26+
patterns:
27+
- "*"
28+
update-types:
29+
- "major"
30+
cooldown:
31+
default-days: 7

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313
# How Has This Been Tested?
1414
<!-- Please describe how you tested your changes. -->
1515

16+
# AI Disclosure
17+
<!-- It helps us review PRs when we know about AI assistance. -->
18+
- [ ] I am a human and didn't use any AI.
19+
- [ ] I used LLM features of my editor, but not an agent.
20+
- [ ] I used an AI agent interactively.
21+
- [ ] I am an agent or I got an agent to do the work autonomously.
22+
23+
# If Your PR Implements or Enhances a Linter
24+
<!-- Humans don't always bring ideal test cases, but unlike AIs, they can learn how to find real-world examples -->
25+
- [ ] I made up the sentences in the unit tests.
26+
- [ ] The sentences in the unit tests were generated by an AI.
27+
- [ ] I'm using examples from the bug report / feature request.
28+
- [ ] I collected real-world sentences for the unit tests.
29+
1630
# Checklist
1731
<!-- Go over all the following points, and put an `x` in all the boxes that apply -->
1832

.github/workflows/binaries.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ jobs:
116116
runs-on: ${{ matrix.platform.os }}
117117
steps:
118118
- name: Checkout
119-
uses: actions/checkout@v4
119+
uses: actions/checkout@v6.0.2
120120
- name: Rust Cache
121-
uses: Swatinem/rust-cache@v2.7.8
121+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
122+
with:
123+
cache-bin: "true"
122124
- name: Build binary
123-
uses: houseabsolute/actions-rust-cross@v1
125+
uses: houseabsolute/actions-rust-cross@fe6ede73c7f0a50412ec05994e2aa5a7bf635eac # v1.0.7
124126
with:
125127
command: ${{ matrix.platform.command }}
126128
target: ${{ matrix.platform.target }}
@@ -138,14 +140,14 @@ jobs:
138140
fi
139141
cd -
140142
- name: Upload Artifacts
141-
uses: actions/upload-artifact@v4
143+
uses: actions/upload-artifact@v7
142144
with:
143145
name: ${{ matrix.platform.bin }}-${{ matrix.platform.target }}
144146
path: ${{ matrix.platform.name }}
145147

146148
- name: Release artifacts
147149
if: startsWith(github.ref, 'refs/tags/v')
148-
uses: ncipollo/release-action@v1
150+
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
149151
with:
150152
artifacts: ${{ matrix.platform.name }}
151153
allowUpdates: true

.github/workflows/build_web.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
build-web:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6.0.2
1515
- name: Setup node
16-
uses: actions/setup-node@v4
16+
uses: actions/setup-node@v6
1717
with:
1818
node-version-file: ".node-version"
1919
- name: Retrieve version after install
2020
id: nodenv
2121
run: echo "node-version=$(node -v | sed 's/^v//')" >> $GITHUB_OUTPUT
22-
- uses: redhat-actions/buildah-build@v2
22+
- uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2.13
2323
with:
2424
image: web
2525
containerfiles: |

.github/workflows/chrome_plugin.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@ jobs:
1515
chrome-plugin:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
19-
- uses: extractions/setup-just@v2
20-
- uses: actions/setup-node@v4
18+
- uses: actions/checkout@v6.0.2
19+
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
20+
- uses: actions/setup-node@v6
2121
with:
2222
node-version-file: ".node-version"
2323
- name: Enable Corepack
2424
run: corepack enable
25-
- uses: cargo-bins/cargo-binstall@main
25+
- uses: cargo-bins/cargo-binstall@f8810ffa11196f23afb38e6fb64716fbf814ad8f # main
2626
- name: Install `wasm-pack`
2727
run: cargo binstall wasm-pack --force --no-confirm
2828
- name: Build Chrome Plugin
2929
run: just build-chrome-plugin
3030
- name: Build Firefox Plugin
3131
run: just build-firefox-plugin
3232
- name: Upload Chrome extension
33-
uses: actions/upload-artifact@v4
33+
uses: actions/upload-artifact@v7
3434
with:
3535
name: harper-chrome-plugin.zip
3636
path: "packages/chrome-plugin/package/harper-chrome-plugin.zip"
3737
- name: Upload Firefox extension
38-
uses: actions/upload-artifact@v4
38+
uses: actions/upload-artifact@v7
3939
with:
4040
name: harper-firefox-plugin.zip
4141
path: "packages/chrome-plugin/package/harper-firefox-plugin.zip"
4242
- name: Release artifacts
43-
uses: ncipollo/release-action@v1
43+
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
4444
if: startsWith(github.ref, 'refs/tags/v')
4545
with:
4646
artifacts: "packages/chrome-plugin/package/*.zip"

0 commit comments

Comments
 (0)