diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40bff11..94be662 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -176,3 +176,40 @@ jobs: Write-Host "`nSubmitting new package to Winget..." ./wingetcreate.exe submit --token ${{ secrets.WINGET_GITHUB_TOKEN }} $manifestDir + + snap: + needs: goreleaser + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Build snap + uses: snapcore/action-build@v1 + id: build + + - name: Publish to Snapcraft Store + uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} + with: + snap: ${{ steps.build.outputs.snap }} + release: stable + + linux-packages: + needs: goreleaser + runs-on: ubuntu-latest + steps: + - name: Trigger linux-packages repo update + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.LINUX_PACKAGES_DISPATCH_TOKEN }} + repository: open-cli-collective/linux-packages + event-type: package-release + client-payload: |- + { + "package": "cfl", + "version": "${{ github.ref_name }}", + "repo": "open-cli-collective/confluence-cli" + } diff --git a/.goreleaser.yml b/.goreleaser.yml index 022a395..07d9cae 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -39,6 +39,23 @@ archives: - LICENSE - README.md +# Linux packages (.deb and .rpm) +nfpms: + - id: cfl + package_name: cfl + vendor: Open CLI Collective + homepage: https://github.com/open-cli-collective/confluence-cli + maintainer: Open CLI Collective + description: Command-line interface for Atlassian Confluence Cloud + license: MIT + formats: + - deb + - rpm + bindir: /usr/bin + contents: + - src: LICENSE + dst: /usr/share/licenses/cfl/LICENSE + # Homebrew cask with auto-quarantine removal for unsigned binaries homebrew_casks: - name: cfl diff --git a/README.md b/README.md index a4dbcea..88f01da 100644 --- a/README.md +++ b/README.md @@ -16,36 +16,118 @@ A command-line interface for Atlassian Confluence Cloud, inspired by [jira-cli]( ## Installation -### Homebrew (macOS/Linux) +### macOS + +**Homebrew (recommended)** ```bash -brew tap open-cli-collective/tap -brew install cfl +brew install open-cli-collective/tap/cfl ``` -### Chocolatey (Windows) +> Note: This installs from our third-party tap. The formula is not yet in Homebrew core. + +**Binary download** + +Download from the [Releases page](https://github.com/open-cli-collective/confluence-cli/releases) - available for Intel and Apple Silicon. + +--- + +### Windows + +**Chocolatey** ```powershell choco install confluence-cli ``` -### Winget (Windows) +**Winget** ```powershell winget install OpenCLICollective.cfl ``` -### Go Install +**Binary download** + +Download from the [Releases page](https://github.com/open-cli-collective/confluence-cli/releases) - available for x64 and ARM64. + +--- + +### Linux + +**Snap (recommended)** + +```bash +sudo snap install ocli-confluence +``` + +The command is `cfl` after installation. + +**APT (Debian/Ubuntu)** ```bash -go install github.com/open-cli-collective/confluence-cli/cmd/cfl@latest +# Add the GPG key +curl -fsSL https://open-cli-collective.github.io/linux-packages/keys/gpg.asc | sudo gpg --dearmor -o /usr/share/keyrings/open-cli-collective.gpg + +# Add the repository +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/open-cli-collective.gpg] https://open-cli-collective.github.io/linux-packages/apt stable main" | sudo tee /etc/apt/sources.list.d/open-cli-collective.list + +# Install +sudo apt update +sudo apt install cfl ``` -### Binary Download +> Note: This is our third-party APT repository, not the official Debian/Ubuntu repos. -Download the latest release from the [Releases page](https://github.com/open-cli-collective/confluence-cli/releases). +**DNF/YUM (Fedora/RHEL/CentOS)** + +```bash +# Add the repository +sudo tee /etc/yum.repos.d/open-cli-collective.repo << 'EOF' +[open-cli-collective] +name=Open CLI Collective +baseurl=https://open-cli-collective.github.io/linux-packages/rpm +enabled=1 +gpgcheck=1 +gpgkey=https://open-cli-collective.github.io/linux-packages/keys/gpg.asc +EOF + +# Install +sudo dnf install cfl +``` + +> Note: This is our third-party RPM repository, not the official Fedora/RHEL repos. + +**Homebrew** + +```bash +brew install open-cli-collective/tap/cfl +``` + +**Binary download** + +Download `.deb`, `.rpm`, or `.tar.gz` from the [Releases page](https://github.com/open-cli-collective/confluence-cli/releases) - available for x64 and ARM64. + +```bash +# Direct .deb install +curl -LO https://github.com/open-cli-collective/confluence-cli/releases/latest/download/cfl_VERSION_linux_amd64.deb +sudo dpkg -i cfl_VERSION_linux_amd64.deb + +# Direct .rpm install +curl -LO https://github.com/open-cli-collective/confluence-cli/releases/latest/download/cfl-VERSION.x86_64.rpm +sudo rpm -i cfl-VERSION.x86_64.rpm +``` + +--- + +### From Source + +**Go install** + +```bash +go install github.com/open-cli-collective/confluence-cli/cmd/cfl@latest +``` -Available for Windows (x64, ARM64), macOS (Intel, Apple Silicon), and Linux (x64, ARM64). +Requires Go 1.22 or later. ## Quick Start diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000..b95d610 --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,61 @@ +name: ocli-confluence +base: core22 +version: git +summary: Command-line interface for Atlassian Confluence Cloud +description: | + cfl is a markdown-first CLI for managing Confluence Cloud pages. + + Features: + - Create, edit, view, and delete pages + - Automatic markdown-to-Confluence conversion + - Space and attachment management + - Table, JSON, and plain output formats + + Run 'cfl init' to configure your Confluence credentials. + +grade: stable +confinement: strict + +architectures: + - build-on: amd64 + - build-on: arm64 + +plugs: + dot-config-cfl: + interface: personal-files + read: + - $HOME/.config/cfl + write: + - $HOME/.config/cfl + +apps: + ocli-confluence: + command: bin/cfl + plugs: + - home + - network + - dot-config-cfl + aliases: + - cfl + +parts: + cfl: + plugin: go + source: . + build-snaps: + - go/1.24/stable + build-environment: + - CGO_ENABLED: "0" + override-build: | + # Get version from git + VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev") + COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") + DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + + # Build with ldflags + go build -o $SNAPCRAFT_PART_INSTALL/bin/cfl \ + -ldflags "-s -w \ + -X github.com/open-cli-collective/confluence-cli/internal/version.Version=${VERSION} \ + -X github.com/open-cli-collective/confluence-cli/internal/version.Commit=${COMMIT} \ + -X github.com/open-cli-collective/confluence-cli/internal/version.Date=${DATE}" \ + ./cmd/cfl