From 52bf76d4403ce006ba3bc85ebcd8233c4971457d Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Sat, 17 Jan 2026 05:02:43 -0500 Subject: [PATCH 1/5] feat: add Chocolatey package for Windows distribution Add Chocolatey package definition to enable Windows users to install via `choco install confluence-cli`. Package features: - Downloads from GitHub Releases (not embedded) - Native ARM64 detection with x64 fallback - Dynamic checksum verification from checksums.txt - Proper shimming (only cfl.exe, not LICENSE/README) Also adds packaging/ directory structure with Homebrew README pointing to GoReleaser config. Fixes #71 --- CLAUDE.md | 18 ++++ packaging/chocolatey/README.md | 96 +++++++++++++++++++ packaging/chocolatey/confluence-cli.nuspec | 32 +++++++ .../chocolatey/tools/chocolateyInstall.ps1 | 43 +++++++++ .../chocolatey/tools/chocolateyUninstall.ps1 | 15 +++ packaging/homebrew/README.md | 17 ++++ 6 files changed, 221 insertions(+) create mode 100644 packaging/chocolatey/README.md create mode 100644 packaging/chocolatey/confluence-cli.nuspec create mode 100644 packaging/chocolatey/tools/chocolateyInstall.ps1 create mode 100644 packaging/chocolatey/tools/chocolateyUninstall.ps1 create mode 100644 packaging/homebrew/README.md diff --git a/CLAUDE.md b/CLAUDE.md index 214a7dc..ae39a8d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -191,3 +191,21 @@ Releases are automated via release-please. When PRs merge to main with conventio **Before merging a PR:** Run `/release-notes` to generate release notes and update the PR description. **After merging:** release-please creates a Release PR. Merging that PR triggers the full release (GitHub Release + Homebrew tap update). + +## Packaging + +Distribution packages are in `packaging/`: + +``` +packaging/ +├── chocolatey/ # Windows Chocolatey package +│ ├── confluence-cli.nuspec +│ ├── tools/chocolateyInstall.ps1 +│ ├── tools/chocolateyUninstall.ps1 +│ └── README.md # Publishing instructions +└── homebrew/ + └── README.md # Points to GoReleaser config +``` + +- **Homebrew**: Managed by GoReleaser, published to [open-cli-collective/homebrew-tap](https://github.com/open-cli-collective/homebrew-tap) +- **Chocolatey**: Manual publish process documented in `packaging/chocolatey/README.md` diff --git a/packaging/chocolatey/README.md b/packaging/chocolatey/README.md new file mode 100644 index 0000000..0a525cc --- /dev/null +++ b/packaging/chocolatey/README.md @@ -0,0 +1,96 @@ +# Chocolatey Package for confluence-cli + +This directory contains the Chocolatey package definition for distributing confluence-cli on Windows. + +## Package Structure + +``` +packaging/chocolatey/ +├── confluence-cli.nuspec # Package manifest +├── tools/ +│ ├── chocolateyInstall.ps1 # Downloads and installs from GitHub Releases +│ └── chocolateyUninstall.ps1 # Cleanup script +└── README.md +``` + +## Local Testing + +### Prerequisites + +- Windows with [Chocolatey installed](https://chocolatey.org/install) +- PowerShell (Admin) + +### Build the Package + +```powershell +cd packaging/chocolatey + +# Update version in nuspec to match a real release (e.g., 0.10.0) +# Then pack: +choco pack +``` + +This creates `confluence-cli..nupkg`. + +### Install Locally + +```powershell +# Install from local package +choco install confluence-cli -s . --force + +# Verify +cfl --version + +# Uninstall +choco uninstall confluence-cli +``` + +## Publishing to Chocolatey Community Repository + +### First-Time Setup + +1. Create an account at https://community.chocolatey.org +2. Get your API key from https://community.chocolatey.org/account +3. Configure your API key: + ```powershell + choco apikey --key --source https://push.chocolatey.org/ + ``` + +### Publishing a New Version + +1. Update the `` in `confluence-cli.nuspec` to match the GitHub release +2. Pack the package: + ```powershell + choco pack + ``` +3. Push to Chocolatey: + ```powershell + choco push confluence-cli..nupkg --source https://push.chocolatey.org/ + ``` + +### Moderation Process + +- New packages go through moderation (typically 1-3 days) +- Automated checks verify the package downloads correctly +- Human moderators review the package +- Status updates are sent via email + +## Architecture Support + +The install script automatically detects Windows architecture: + +| Architecture | Download | +|--------------|----------| +| ARM64 | `cfl__windows_arm64.zip` | +| x64 | `cfl__windows_amd64.zip` | +| x86 | Not supported (error) | + +## Updating for New Releases + +When a new version is released on GitHub: + +1. Update `` in `confluence-cli.nuspec` +2. Test locally with `choco pack && choco install confluence-cli -s . --force` +3. Push to Chocolatey with `choco push` + +The install script dynamically fetches checksums from `checksums.txt` in the GitHub release, so no checksum updates are needed in the package files. diff --git a/packaging/chocolatey/confluence-cli.nuspec b/packaging/chocolatey/confluence-cli.nuspec new file mode 100644 index 0000000..97f132b --- /dev/null +++ b/packaging/chocolatey/confluence-cli.nuspec @@ -0,0 +1,32 @@ + + + + confluence-cli + 0.0.0 + Confluence CLI + Open CLI Collective + rianjs + https://github.com/open-cli-collective/confluence-cli/blob/main/LICENSE + https://github.com/open-cli-collective/confluence-cli + https://github.com/open-cli-collective/confluence-cli + https://github.com/open-cli-collective/confluence-cli/tree/main/packaging/chocolatey + https://github.com/open-cli-collective/confluence-cli/issues + false + A command-line interface for Atlassian Confluence Cloud. Provides markdown-first page management with automatic conversion between Markdown and Confluence's storage format. + +Features: +- Create, edit, view, and delete Confluence pages +- Bidirectional Markdown to Confluence HTML conversion +- Attachment management (upload, download, list) +- Space listing and search +- Support for Confluence macros (TOC, panels, expand) + +Binary: cfl.exe + Command-line interface for Atlassian Confluence Cloud + https://github.com/open-cli-collective/confluence-cli/releases + confluence atlassian cli markdown wiki documentation + + + + + diff --git a/packaging/chocolatey/tools/chocolateyInstall.ps1 b/packaging/chocolatey/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..5b088c8 --- /dev/null +++ b/packaging/chocolatey/tools/chocolateyInstall.ps1 @@ -0,0 +1,43 @@ +$ErrorActionPreference = 'Stop' + +$version = $env:ChocolateyPackageVersion +$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition + +# Architecture detection with ARM64 support +if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + $arch = 'arm64' +} elseif ([Environment]::Is64BitOperatingSystem) { + $arch = 'amd64' +} else { + throw "32-bit Windows is not supported. confluence-cli requires 64-bit Windows." +} + +$baseUrl = "https://github.com/open-cli-collective/confluence-cli/releases/download/v${version}" +$zipFile = "cfl_${version}_windows_${arch}.zip" +$url = "${baseUrl}/${zipFile}" +$checksumsUrl = "${baseUrl}/checksums.txt" + +# Fetch checksums and extract the one for our architecture +$checksums = (Invoke-WebRequest -Uri $checksumsUrl -UseBasicParsing).Content +$checksumLine = $checksums -split "`n" | Where-Object { $_ -match $zipFile } +if (-not $checksumLine) { + throw "Could not find checksum for ${zipFile} in checksums.txt" +} +$checksum = ($checksumLine -split '\s+')[0] + +Write-Host "Installing confluence-cli ${version} for Windows ${arch}..." +Write-Host "URL: ${url}" +Write-Host "Checksum (SHA256): ${checksum}" + +Install-ChocolateyZipPackage -PackageName $env:ChocolateyPackageName ` + -Url $url ` + -UnzipLocation $toolsDir ` + -Checksum $checksum ` + -ChecksumType 'sha256' + +# Exclude non-executables from shimming +# Chocolatey auto-creates shims for .exe files; .ignore files prevent shimming other files +New-Item "$toolsDir\LICENSE.ignore" -Type File -Force | Out-Null +New-Item "$toolsDir\README.md.ignore" -Type File -Force | Out-Null + +Write-Host "confluence-cli installed successfully. Run 'cfl --help' to get started." diff --git a/packaging/chocolatey/tools/chocolateyUninstall.ps1 b/packaging/chocolatey/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..8c1db3d --- /dev/null +++ b/packaging/chocolatey/tools/chocolateyUninstall.ps1 @@ -0,0 +1,15 @@ +$ErrorActionPreference = 'Stop' + +$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition + +Write-Host "Uninstalling confluence-cli..." + +# Remove extracted files +Remove-Item "$toolsDir\cfl.exe" -Force -ErrorAction SilentlyContinue +Remove-Item "$toolsDir\LICENSE" -Force -ErrorAction SilentlyContinue +Remove-Item "$toolsDir\README.md" -Force -ErrorAction SilentlyContinue + +# Remove .ignore files created during install +Remove-Item "$toolsDir\*.ignore" -Force -ErrorAction SilentlyContinue + +Write-Host "confluence-cli has been uninstalled." diff --git a/packaging/homebrew/README.md b/packaging/homebrew/README.md new file mode 100644 index 0000000..f003107 --- /dev/null +++ b/packaging/homebrew/README.md @@ -0,0 +1,17 @@ +# Homebrew Distribution + +Homebrew packaging is managed automatically by [GoReleaser](https://goreleaser.com/) during the release process. + +## Configuration + +The Homebrew cask configuration lives in [`.goreleaser.yml`](../../.goreleaser.yml) under the `homebrew_casks` section. + +## Tap Repository + +The generated cask is published to: https://github.com/open-cli-collective/homebrew-tap + +## Installation + +```bash +brew install open-cli-collective/tap/cfl +``` From 0b33283d9a539d69344154f478d2c9a1dfcac022 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Sat, 17 Jan 2026 05:08:54 -0500 Subject: [PATCH 2/5] ci: add workflow to test Chocolatey package on Windows --- .github/workflows/test-chocolatey.yml | 83 +++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/test-chocolatey.yml diff --git a/.github/workflows/test-chocolatey.yml b/.github/workflows/test-chocolatey.yml new file mode 100644 index 0000000..a9fd22d --- /dev/null +++ b/.github/workflows/test-chocolatey.yml @@ -0,0 +1,83 @@ +name: Test Chocolatey Package + +on: + pull_request: + paths: + - 'packaging/chocolatey/**' + - '.github/workflows/test-chocolatey.yml' + push: + branches: [main] + paths: + - 'packaging/chocolatey/**' + - '.github/workflows/test-chocolatey.yml' + +jobs: + test-chocolatey: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.22' + + - name: Build binary for testing + run: go build -o packaging/chocolatey/tools/cfl.exe ./cmd/cfl + + - name: Prepare test package + shell: pwsh + working-directory: packaging/chocolatey + run: | + # Replace placeholder version with test version + (Get-Content confluence-cli.nuspec) ` + -replace '0.0.0', '0.0.1-test' | + Set-Content confluence-cli.nuspec + + # Create a simple install script that uses the local binary + # (the real script downloads from GitHub, but we test structure here) + @' + $ErrorActionPreference = 'Stop' + $toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition + + # Binary is already in tools/ from CI build + Write-Host "confluence-cli installed from local build for testing" + + # Exclude non-executables from shimming + New-Item "$toolsDir\LICENSE.ignore" -Type File -Force | Out-Null + New-Item "$toolsDir\README.md.ignore" -Type File -Force | Out-Null + '@ | Set-Content tools/chocolateyInstall.ps1 + + - name: Pack Chocolatey package + shell: pwsh + working-directory: packaging/chocolatey + run: choco pack + + - name: Install package locally + shell: pwsh + working-directory: packaging/chocolatey + run: choco install confluence-cli -dv -s . --force + + - name: Verify installation + shell: pwsh + run: | + Write-Host "Testing cfl --version..." + cfl --version + if ($LASTEXITCODE -ne 0) { + Write-Error "cfl --version failed" + exit 1 + } + Write-Host "cfl is working!" + + - name: Test uninstall + shell: pwsh + run: | + choco uninstall confluence-cli -y + + # Verify cfl is no longer available + $cflPath = Get-Command cfl -ErrorAction SilentlyContinue + if ($cflPath) { + Write-Error "cfl should not be available after uninstall" + exit 1 + } + Write-Host "Uninstall successful!" From 373c52c50ad6e4841300e28b398ffa07411bc368 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Sat, 17 Jan 2026 05:11:41 -0500 Subject: [PATCH 3/5] fix: use non-prerelease version in Chocolatey CI test --- .github/workflows/test-chocolatey.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-chocolatey.yml b/.github/workflows/test-chocolatey.yml index a9fd22d..2d87c6d 100644 --- a/.github/workflows/test-chocolatey.yml +++ b/.github/workflows/test-chocolatey.yml @@ -29,9 +29,9 @@ jobs: shell: pwsh working-directory: packaging/chocolatey run: | - # Replace placeholder version with test version + # Replace placeholder version with test version (must not be prerelease) (Get-Content confluence-cli.nuspec) ` - -replace '0.0.0', '0.0.1-test' | + -replace '0.0.0', '0.0.1' | Set-Content confluence-cli.nuspec # Create a simple install script that uses the local binary From df35bebf9056c0cac0854036f6551969ad483e99 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Sat, 17 Jan 2026 05:15:14 -0500 Subject: [PATCH 4/5] docs: add Chocolatey installation instructions to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6733f83..2fa7fe8 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ brew tap open-cli-collective/tap brew install --cask cfl ``` +### Chocolatey (Windows) + +```powershell +choco install confluence-cli +``` + ### Go Install ```bash From 7fea3bd1baf7a825d295b90e1e2dae1dbbc6c846 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Sat, 17 Jan 2026 05:16:36 -0500 Subject: [PATCH 5/5] docs: remove Chocolatey from README until published --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 2fa7fe8..6733f83 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,6 @@ brew tap open-cli-collective/tap brew install --cask cfl ``` -### Chocolatey (Windows) - -```powershell -choco install confluence-cli -``` - ### Go Install ```bash