Skip to content

Commit b9dfaf9

Browse files
committed
Update docs for bundled binary builds, dry runs, and recovery
1 parent 9c8547c commit b9dfaf9

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

CLAUDE.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ test/
2828
## Key Design Decisions
2929

3030
- **Eager registration:** Decoration provider is registered before repo scanning completes. The git extension may not have discovered repositories when we activate (`onStartupFinished`), so gating on repo state causes missed decorations.
31-
- **PATH augmentation:** The VSCode extension host has a minimal PATH. `src/extension.ts` appends `/opt/homebrew/bin`, `/usr/local/bin`, `/usr/bin` to `process.env.PATH` on the shared extension host so `git-crypt` is discoverable by all extensions (including the built-in git extension's clean/smudge filter invocations). This is the extension's primary function.
31+
- **PATH augmentation:** The VSCode extension host has a minimal PATH. `src/extension.ts` appends `/opt/homebrew/bin`, `/usr/local/bin`, `/usr/bin`, and the bundled `bin/` directory to `process.env.PATH` on the shared extension host so `git-crypt` is discoverable by all extensions (including the built-in git extension's clean/smudge filter invocations). User-installed git-crypt takes precedence; the bundled binary is appended last. This is the extension's primary function.
32+
- **Bundled binary:** Platform-specific VSIX files ship a statically linked git-crypt binary (macOS arm64, Linux x64/arm64). A universal VSIX (no binary) is also published for unsupported platforms. The binary version is pinned in `git-crypt-version.txt` with a sha256 checksum.
3233
- **Unlock detection via key directory:** `isRepoUnlocked()` checks for `.git/git-crypt/keys/` existence rather than parsing `git-crypt status` output (which is slow on large repos and ambiguous -- it labels managed files as "encrypted:" even when unlocked).
3334
- **No shell execution:** All git commands use `execFile` with array arguments to prevent command injection.
3435

@@ -45,11 +46,13 @@ Tests create a temporary git-crypt repo via `test/fixture.ts` (requires `git-cry
4546
1. **preversion** -- branch guard (must be on `main`), build, test
4647
2. Version bump, commit, `v*` tag
4748
3. **postversion** -- pushes commit + tag to origin
48-
4. CI: tests -> tag/version mismatch check -> package -> GitHub release -> marketplace publish
49+
4. CI: tests -> build static binaries -> package platform-specific + universal VSIX -> GitHub release -> marketplace publish
4950

50-
Recovery from CI failure: `npm run retag` (force-moves tag to HEAD, re-triggers CI).
51+
Recovery from CI failure: `npm run retag` (force-moves tag to HEAD, re-triggers CI). If marketplace publish fails after GH release succeeds, bump version and release again (marketplace rejects same-version re-publishes).
5152

52-
Branches: `main` (releases), `dev` (test-only CI, no publish).
53+
Dry runs: `gh workflow run ci.yml --ref dev` runs the full build/package pipeline with `dry_run=true` (default). Marketplace publish is also guarded against non-main branches.
54+
55+
Branches: `main` (releases), `dev` (CI runs tests + dry-run builds, no publish).
5356

5457
## Installation (Development)
5558

CONTRIBUTING.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,48 @@ This single command:
5454

5555
CI then takes over:
5656

57-
5. Runs tests on the pushed tag
58-
6. Validates the tag matches package.json version
59-
7. Packages the VSIX and creates a GitHub release with it attached
60-
8. Publishes to the VS Code Marketplace
57+
5. Runs tests
58+
6. Validates the tag is on `main` and matches package.json version
59+
7. Builds static git-crypt binaries for macOS (arm64) and Linux (x64, arm64)
60+
8. Packages platform-specific VSIX files (with bundled binary) and a universal VSIX (without)
61+
9. Creates a GitHub release with all VSIX files attached
62+
10. Publishes all VSIX files to the VS Code Marketplace
63+
64+
### Dry Runs
65+
66+
Trigger the full build/package pipeline without publishing:
67+
68+
```bash
69+
gh workflow run ci.yml --ref dev
70+
```
71+
72+
This runs with `dry_run=true` (the default), which builds binaries, packages VSIX files, and verifies their contents -- but skips the GitHub release and marketplace publish steps. Uncheck `dry_run` in the GitHub UI to publish from a manual dispatch (only allowed from `main`).
6173

6274
### Recovery
6375

64-
If CI fails after the tag is pushed (e.g. marketplace timeout), fix the issue and retag:
76+
**CI fails before publish** (tests, build, packaging): fix the issue and retag:
6577

6678
```bash
6779
npm run retag
6880
```
6981

7082
This force-moves the tag to the current commit and pushes it, re-triggering CI.
7183

84+
**Marketplace publish fails after GitHub release succeeds**: the marketplace rejects same-version re-publishes, so `retag` alone won't work. Bump the version and release again:
85+
86+
```bash
87+
npm version patch
88+
```
89+
7290
### Branches
7391

7492
- **main** -- releases happen here; `npm version` enforces this via a branch guard
75-
- **dev** -- CI runs tests only; publish job verifies the tag is on main before proceeding
93+
- **dev** -- CI runs tests and dry-run builds; publish steps are gated behind `dry_run` input and a main-branch guard
7694

7795
## CI
7896

7997
GitHub Actions (`.github/workflows/ci.yml`):
8098

81-
- **test** job runs on every push to `main`/`dev` and on PRs to `main`
82-
- **publish** job runs only on `v*` tags on `main`, after tests pass
99+
- **test** -- runs on every push to `main`/`dev` and on PRs to `main`
100+
- **build-git-crypt** -- compiles static git-crypt binaries on macOS (arm64 via macos-15) and Linux (x64 and arm64 via Alpine Docker, arm64 uses QEMU). Runs on tags and `workflow_dispatch`
101+
- **publish** -- packages platform-specific and universal VSIX files, verifies contents, optionally creates GitHub release and publishes to marketplace. Release/publish steps are controlled by the `dry_run` input (defaults to true on manual dispatch; always false on tag pushes)

0 commit comments

Comments
 (0)