Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.
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
83 changes: 83 additions & 0 deletions .github/workflows/test-chocolatey.yml
Original file line number Diff line number Diff line change
@@ -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 (must not be prerelease)
(Get-Content confluence-cli.nuspec) `
-replace '<version>0.0.0</version>', '<version>0.0.1</version>' |
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!"
18 changes: 18 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
96 changes: 96 additions & 0 deletions packaging/chocolatey/README.md
Original file line number Diff line number Diff line change
@@ -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.<version>.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 <your-api-key> --source https://push.chocolatey.org/
```

### Publishing a New Version

1. Update the `<version>` 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.<version>.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_<version>_windows_arm64.zip` |
| x64 | `cfl_<version>_windows_amd64.zip` |
| x86 | Not supported (error) |

## Updating for New Releases

When a new version is released on GitHub:

1. Update `<version>` 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.
32 changes: 32 additions & 0 deletions packaging/chocolatey/confluence-cli.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>confluence-cli</id>
<version>0.0.0</version>
<title>Confluence CLI</title>
<authors>Open CLI Collective</authors>
<owners>rianjs</owners>
<licenseUrl>https://github.com/open-cli-collective/confluence-cli/blob/main/LICENSE</licenseUrl>
<projectUrl>https://github.com/open-cli-collective/confluence-cli</projectUrl>
<projectSourceUrl>https://github.com/open-cli-collective/confluence-cli</projectSourceUrl>
<packageSourceUrl>https://github.com/open-cli-collective/confluence-cli/tree/main/packaging/chocolatey</packageSourceUrl>
<bugTrackerUrl>https://github.com/open-cli-collective/confluence-cli/issues</bugTrackerUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>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</description>
<summary>Command-line interface for Atlassian Confluence Cloud</summary>
<releaseNotes>https://github.com/open-cli-collective/confluence-cli/releases</releaseNotes>
<tags>confluence atlassian cli markdown wiki documentation</tags>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
43 changes: 43 additions & 0 deletions packaging/chocolatey/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -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."
15 changes: 15 additions & 0 deletions packaging/chocolatey/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -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."
17 changes: 17 additions & 0 deletions packaging/homebrew/README.md
Original file line number Diff line number Diff line change
@@ -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
```
Loading