-
Notifications
You must be signed in to change notification settings - Fork 25
Release automation #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Release automation #127
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7424b57
ci(release): add Windows target and cross-platform packaging
kevincodex1 b452af6
feat(release): vendor npm wrapper and auto-publish to npm
kevincodex1 aead0f5
feat(release): auto-bump Homebrew tap on release
kevincodex1 2df3ffc
feat(release): Windows installer and web auto-sync on release
kevincodex1 a96d21d
docs(readme): document npm, Homebrew, and Windows install methods
kevincodex1 2e365d1
ci(release): build only CLI binaries on Windows
kevincodex1 8092c9d
fix(release): reconcile release-please manifest with v0.3.9 and bump …
kevincodex1 775545f
ci(release): set explicit minimal permissions on homebrew-bump and we…
kevincodex1 b0403c8
fix(release): harden installers and workflow per review
kevincodex1 762b5ad
fix(installer): require core CLI binaries on Windows
kevincodex1 36829d6
ci(release): make Windows non-blocking and stop persisting cross-repo…
kevincodex1 016e4c0
fix(release): gate web-sync on binaries and detect native arch in ins…
kevincodex1 30a175a
ci(release): make npm publish idempotent across reruns
kevincodex1 7bed605
fix(release): harden web-sync and tap commit per review
kevincodex1 475a018
ci(release): guard npm-publish before doing any work
kevincodex1 40ca937
fix(release): robust web PR error handling and Windows installer hard…
kevincodex1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| ".": "0.3.8" | ||
| ".": "0.3.9" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| gitlawb installer for Windows - downloads pre-built binaries from GitHub Releases. | ||
| .EXAMPLE | ||
| irm https://gitlawb.com/install.ps1 | iex | ||
| .EXAMPLE | ||
| & ([scriptblock]::Create((irm https://gitlawb.com/install.ps1))) -Version v0.3.9 | ||
| #> | ||
| [CmdletBinding()] | ||
| param( | ||
| [string]$Version = "latest" | ||
| ) | ||
|
|
||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| # Windows PowerShell 5.1 may default to TLS 1.0; GitHub requires TLS 1.2+. | ||
| [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 | ||
|
|
||
| $Repo = if ($env:GITLAWB_RELEASE_REPO) { $env:GITLAWB_RELEASE_REPO } else { "Gitlawb/node" } | ||
| $InstallDir = if ($env:GITLAWB_INSTALL_DIR) { $env:GITLAWB_INSTALL_DIR } else { "$env:LOCALAPPDATA\Programs\gitlawb" } | ||
|
|
||
| $arch = if ($env:PROCESSOR_ARCHITEW6432) { | ||
| $env:PROCESSOR_ARCHITEW6432 | ||
| } else { | ||
| $env:PROCESSOR_ARCHITECTURE | ||
| } | ||
| if ($arch -ne "AMD64") { | ||
| throw "Unsupported architecture: $arch. Only x64 Windows binaries are published. Use WSL for arm64." | ||
| } | ||
| $target = "x86_64-pc-windows-msvc" | ||
|
|
||
| if ($Version -eq "latest") { | ||
| Write-Host "Fetching latest release version..." | ||
| $rel = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases/latest" -UseBasicParsing -Headers @{ "User-Agent" = "gitlawb-installer" } | ||
| $tag = $rel.tag_name | ||
| } elseif ($Version.StartsWith("v")) { | ||
| $tag = $Version | ||
| } else { | ||
| $tag = "v$Version" | ||
| } | ||
| $ver = $tag.TrimStart("v") | ||
|
|
||
| $archive = "gitlawb-node-$ver-$target.zip" | ||
| $url = "https://github.com/$Repo/releases/download/$tag/$archive" | ||
|
|
||
| Write-Host "Installing gitlawb $tag for windows/x64" | ||
| Write-Host " Archive: $archive" | ||
| Write-Host " Into: $InstallDir" | ||
|
|
||
| $tmp = Join-Path ([System.IO.Path]::GetTempPath()) ("gitlawb-" + [System.Guid]::NewGuid().ToString("N")) | ||
| New-Item -ItemType Directory -Path $tmp | Out-Null | ||
| try { | ||
| $zipPath = Join-Path $tmp $archive | ||
| Write-Host "Downloading..." | ||
| Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing -Headers @{ "User-Agent" = "gitlawb-installer" } | ||
|
|
||
| # Verify checksum. Every published asset has a matching .sha256, so fail closed | ||
| # if it cannot be fetched rather than installing an unverified binary. | ||
| $sumPath = "$zipPath.sha256" | ||
| Invoke-WebRequest -Uri "$url.sha256" -OutFile $sumPath -UseBasicParsing -Headers @{ "User-Agent" = "gitlawb-installer" } | ||
| $expected = ((Get-Content $sumPath -Raw).Trim() -split '\s+')[0].ToLower() | ||
| $actual = (Get-FileHash $zipPath -Algorithm SHA256).Hash.ToLower() | ||
| if ($expected -ne $actual) { | ||
| throw "checksum mismatch! expected $expected got $actual" | ||
| } | ||
| Write-Host " checksum OK" | ||
|
|
||
| Write-Host "Extracting..." | ||
| $extract = Join-Path $tmp "extract" | ||
| Expand-Archive -Path $zipPath -DestinationPath $extract -Force | ||
| $pkgDir = Get-ChildItem -Path $extract -Directory | Select-Object -First 1 | ||
|
|
||
| New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null | ||
| # The Windows archive always ships the two CLI binaries; the daemon is optional. | ||
| $requiredBins = @("gl.exe", "git-remote-gitlawb.exe") | ||
| $optionalBins = @("gitlawb-node.exe") | ||
| $missing = $requiredBins | Where-Object { | ||
| -not (Test-Path (Join-Path $pkgDir.FullName $_)) | ||
| } | ||
| if ($missing.Count -gt 0) { | ||
| throw "archive is missing required binaries: $($missing -join ', ')" | ||
| } | ||
|
|
||
| $installed = @() | ||
| foreach ($bin in $requiredBins + $optionalBins) { | ||
| $src = Join-Path $pkgDir.FullName $bin | ||
| if (Test-Path $src) { | ||
| Copy-Item -Path $src -Destination (Join-Path $InstallDir $bin) -Force | ||
| $installed += $bin | ||
| } | ||
| } | ||
|
|
||
| # Drop binaries no longer shipped (e.g. an optional one removed in a new release) | ||
| # so an upgrade in place never leaves a stale, mixed-version install behind. | ||
| foreach ($bin in $requiredBins + $optionalBins) { | ||
| if ($installed -notcontains $bin) { | ||
| $dst = Join-Path $InstallDir $bin | ||
| if (Test-Path $dst) { Remove-Item -Path $dst -Force } | ||
| } | ||
| } | ||
|
|
||
| Write-Host "" | ||
| Write-Host "Installed gitlawb $tag" | ||
| foreach ($bin in $installed) { Write-Host " $bin -> $InstallDir\$bin" } | ||
| } | ||
| finally { | ||
| Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue | ||
| } | ||
|
|
||
| # Add to the user PATH if missing. | ||
| $userPath = [Environment]::GetEnvironmentVariable("Path", "User") | ||
| if (($userPath -split ';') -notcontains $InstallDir) { | ||
| $newPath = if ([string]::IsNullOrEmpty($userPath)) { $InstallDir } else { "$userPath;$InstallDir" } | ||
| [Environment]::SetEnvironmentVariable("Path", $newPath, "User") | ||
| Write-Host "" | ||
| Write-Host "Added $InstallDir to your PATH. Restart your terminal, then run:" | ||
| } else { | ||
| Write-Host "" | ||
| Write-Host "Run:" | ||
| } | ||
| Write-Host " gl doctor" | ||
| Write-Host " gl quickstart" | ||
| Write-Host "" | ||
| Write-Host "Docs: https://docs.gitlawb.com" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| node_modules/ | ||
|
|
||
| # Platform binaries — laid in by the release workflow at publish time, not committed. | ||
| packages/gl-darwin-arm64/gl | ||
| packages/gl-darwin-arm64/git-remote-gitlawb | ||
| packages/gl-darwin-x64/gl | ||
| packages/gl-darwin-x64/git-remote-gitlawb | ||
| packages/gl-linux-arm64/gl | ||
| packages/gl-linux-arm64/git-remote-gitlawb | ||
| packages/gl-linux-x64/gl | ||
| packages/gl-linux-x64/git-remote-gitlawb | ||
|
|
||
| # Wrapper bin placeholders are overwritten by postinstall. | ||
| packages/gl/bin/gl | ||
| packages/gl/bin/git-remote-gitlawb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # npm distribution for the gitlawb CLI | ||
|
|
||
| This directory packages the `gl` and `git-remote-gitlawb` binaries as the | ||
| [`@gitlawb/gl`](https://www.npmjs.com/package/@gitlawb/gl) npm package. | ||
|
|
||
| It uses the **optionalDependencies platform-package** pattern (the same one | ||
| esbuild/swc/turbo use): the wrapper `@gitlawb/gl` declares four per-platform | ||
| packages as `optionalDependencies`, each gated by `os`/`cpu`. npm installs only | ||
| the one matching the host, and the wrapper's `postinstall` (`install.js`) copies | ||
| the binary out of it into `bin/`. No binaries are downloaded at install time. | ||
|
|
||
| ```text | ||
| packages/ | ||
| gl/ @gitlawb/gl wrapper (postinstall, bin shims) | ||
| gl-darwin-arm64/ @gitlawb/gl-darwin-arm64 aarch64-apple-darwin | ||
| gl-darwin-x64/ @gitlawb/gl-darwin-x64 x86_64-apple-darwin | ||
| gl-linux-arm64/ @gitlawb/gl-linux-arm64 aarch64-unknown-linux-musl | ||
| gl-linux-x64/ @gitlawb/gl-linux-x64 x86_64-unknown-linux-musl | ||
| ``` | ||
|
|
||
| ## Publishing | ||
|
|
||
| Publishing is **automated** by `.github/workflows/release.yml` (the `npm-publish` | ||
| job) on every release-please release. That job: | ||
|
|
||
| 1. Downloads the four unix release tarballs from the `Gitlawb/node` GitHub release. | ||
| 2. Lays `gl` + `git-remote-gitlawb` into each platform package. | ||
| 3. Rewrites every `package.json` `version` (and the wrapper's | ||
| `optionalDependencies` pins) to the release version. | ||
| 4. Publishes the four platform packages first, then the wrapper, with | ||
| `npm publish --provenance --access public`. | ||
|
|
||
| The committed `version` fields here are placeholders; the workflow is the single | ||
| source of truth and always uses the release tag. There is no manual publish step. | ||
|
|
||
| Windows is intentionally not published to npm — the wrapper points Windows users | ||
| at the curl/PowerShell installer instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "@gitlawb/gl-darwin-arm64", | ||
| "version": "0.3.9", | ||
| "description": "Gitlawb CLI binary for macOS Apple Silicon (arm64)", | ||
| "license": "MIT", | ||
| "os": ["darwin"], | ||
| "cpu": ["arm64"], | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org/" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/Gitlawb/node", | ||
| "directory": "npm/packages/gl-darwin-arm64" | ||
| }, | ||
| "files": [ | ||
| "gl", | ||
| "git-remote-gitlawb" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "@gitlawb/gl-darwin-x64", | ||
| "version": "0.3.9", | ||
| "description": "Gitlawb CLI binary for macOS Intel (x64)", | ||
| "license": "MIT", | ||
| "os": ["darwin"], | ||
| "cpu": ["x64"], | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org/" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/Gitlawb/node", | ||
| "directory": "npm/packages/gl-darwin-x64" | ||
| }, | ||
| "files": [ | ||
| "gl", | ||
| "git-remote-gitlawb" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "@gitlawb/gl-linux-arm64", | ||
| "version": "0.3.9", | ||
| "description": "Gitlawb CLI binary for Linux arm64", | ||
| "license": "MIT", | ||
| "os": ["linux"], | ||
| "cpu": ["arm64"], | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org/" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/Gitlawb/node", | ||
| "directory": "npm/packages/gl-linux-arm64" | ||
| }, | ||
| "files": [ | ||
| "gl", | ||
| "git-remote-gitlawb" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "@gitlawb/gl-linux-x64", | ||
| "version": "0.3.9", | ||
| "description": "Gitlawb CLI binary for Linux x64", | ||
| "license": "MIT", | ||
| "os": ["linux"], | ||
| "cpu": ["x64"], | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org/" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/Gitlawb/node", | ||
| "directory": "npm/packages/gl-linux-x64" | ||
| }, | ||
| "files": [ | ||
| "gl", | ||
| "git-remote-gitlawb" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # @gitlawb/gl | ||
|
|
||
| The [gitlawb](https://gitlawb.com) CLI — decentralized git for AI agents and developers. | ||
|
|
||
| ## Install | ||
|
|
||
| ```bash | ||
| # macOS / Linux / WSL | ||
| npm install -g @gitlawb/gl | ||
| ``` | ||
|
|
||
| Also works with yarn, pnpm, and bun: | ||
|
|
||
| ```bash | ||
| # macOS / Linux / WSL | ||
| yarn global add @gitlawb/gl | ||
| pnpm add -g @gitlawb/gl | ||
| bun add -g @gitlawb/gl | ||
| ``` | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| Native Windows is not supported via npm — use the PowerShell installer below. | ||
|
|
||
| ### Other install methods | ||
|
|
||
| ```bash | ||
| # Homebrew | ||
| brew install gitlawb/tap/gl | ||
|
|
||
| # curl (macOS / Linux) | ||
| curl -sSf https://gitlawb.com/install.sh | sh | ||
|
|
||
| # PowerShell (Windows) | ||
| irm https://gitlawb.com/install.ps1 | iex | ||
| ``` | ||
|
|
||
| ## Quick start | ||
|
|
||
| ```bash | ||
| gl identity new | ||
| gl register | ||
| gl doctor | ||
| gl repo create my-project --description "My first gitlawb repo" | ||
| git remote add gitlawb gitlawb://my-project | ||
| git push gitlawb main | ||
| ``` | ||
|
|
||
| ## What's included | ||
|
|
||
| - **`gl`** — the main CLI for identity, repos, PRs, bounties, and agents | ||
| - **`git-remote-gitlawb`** — git remote helper for `gitlawb://` URLs | ||
|
|
||
| ## Supported platforms | ||
|
|
||
| | Platform | Architecture | Package | | ||
| |----------|-------------|---------| | ||
| | macOS | Apple Silicon (arm64) | `@gitlawb/gl-darwin-arm64` | | ||
| | macOS | Intel (x64) | `@gitlawb/gl-darwin-x64` | | ||
| | Linux | arm64 | `@gitlawb/gl-linux-arm64` | | ||
| | Linux | x64 | `@gitlawb/gl-linux-x64` | | ||
|
|
||
| Windows is supported via the PowerShell installer or WSL. | ||
|
|
||
| ## Links | ||
|
|
||
| - Docs: https://docs.gitlawb.com | ||
| - Site: https://gitlawb.com | ||
| - Source: https://github.com/Gitlawb/node | ||
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.