Summary
Add Linux distribution support for jira-ticket-cli (jtk), enabling users to install via Snap Store, APT (Debian/Ubuntu), and DNF/YUM (Fedora/RHEL/CentOS).
Reference implementation: confluence-cli PR #96 and the linux-distribution.md guide.
Current State
- GoReleaser already builds Linux binaries for amd64/arm64
- No nfpms section (no .deb/.rpm packages generated)
- No snap/snapcraft.yaml
- No snap or linux-packages jobs in release workflow
Tasks
Part 1: GoReleaser nfpms Configuration
# Linux packages (.deb and .rpm)
nfpms:
- id: jtk
package_name: jtk
vendor: Open CLI Collective
homepage: https://github.com/open-cli-collective/jira-ticket-cli
maintainer: Open CLI Collective <https://github.com/open-cli-collective>
description: Command-line interface for Jira Cloud
license: MIT
formats:
- deb
- rpm
bindir: /usr/bin
contents:
- src: LICENSE
dst: /usr/share/licenses/jtk/LICENSE
Part 2: Snap Package Setup
name: <snap-name> # jtk or ocli-jira
base: core22
version: git
summary: Command-line interface for Jira Cloud
description: |
jtk is a CLI for managing Jira Cloud tickets.
Features:
- List, create, update, and search issues
- Manage sprints and boards
- Add comments and perform transitions
- Table, JSON, and plain output formats
Run 'jtk config set' to configure your Jira credentials.
grade: stable
confinement: strict
architectures:
- build-on: amd64
- build-on: arm64
plugs:
dot-config-jira-ticket-cli:
interface: personal-files
read:
- $HOME/.config/jira-ticket-cli
write:
- $HOME/.config/jira-ticket-cli
apps:
<snap-name>:
command: bin/jtk
plugs:
- home
- network
- dot-config-jira-ticket-cli
aliases:
- jtk # Only needed if snap-name != jtk
parts:
jtk:
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/jtk \
-ldflags "-s -w \
-X github.com/open-cli-collective/jira-ticket-cli/internal/version.Version=${VERSION} \
-X github.com/open-cli-collective/jira-ticket-cli/internal/version.Commit=${COMMIT} \
-X github.com/open-cli-collective/jira-ticket-cli/internal/version.BuildDate=${DATE}" \
./cmd/jtk
Part 3: linux-packages Repository Integration
Part 4: Release Workflow Updates
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": "jtk",
"version": "${{ github.ref_name }}",
"repo": "open-cli-collective/jira-ticket-cli"
}
Part 5: README Documentation
Snap (recommended)
sudo snap install <snap-name>
APT (Debian/Ubuntu)
# 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 jtk
Note: This is our third-party APT repository, not official Debian/Ubuntu repos.
DNF/YUM (Fedora/RHEL/CentOS)
# 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 jtk
Note: This is our third-party RPM repository, not official Fedora/RHEL repos.
Binary download
Download .deb, .rpm, or .tar.gz from the Releases page.
Part 6: Pre-Release Verification
Secrets Checklist
| Secret |
Purpose |
Status |
SNAPCRAFT_STORE_CREDENTIALS |
Publish to Snap Store |
To be added |
LINUX_PACKAGES_DISPATCH_TOKEN |
Trigger linux-packages workflow |
To be added |
TAP_GITHUB_TOKEN |
Homebrew tap updates |
Already exists |
CHOCOLATEY_API_KEY |
Chocolatey publishing |
Already exists |
WINGET_GITHUB_TOKEN |
Winget PR creation |
Already exists |
Files to Create/Modify
| File |
Action |
.goreleaser.yml |
Add nfpms section |
snap/snapcraft.yaml |
Create new file |
.github/workflows/release.yml |
Add snap and linux-packages jobs |
README.md |
Add Linux installation instructions |
linux-packages/README.md |
Add jtk to packages table (separate PR) |
References
Summary
Add Linux distribution support for jira-ticket-cli (jtk), enabling users to install via Snap Store, APT (Debian/Ubuntu), and DNF/YUM (Fedora/RHEL/CentOS).
Reference implementation: confluence-cli PR #96 and the linux-distribution.md guide.
Current State
Tasks
Part 1: GoReleaser nfpms Configuration
nfpmssection to.goreleaser.yml(afterarchives, beforehomebrew_casks):goreleaser check && goreleaser build --snapshot --cleandist/*.debanddist/*.rpmare generatedPart 2: Snap Package Setup
jtkfirst, fallback toocli-jira)snapcraft login && snapcraft register <snap-name>snap/snapcraft.yaml:snapcraft export-login --snaps=<snap-name> --acls=package_upload /tmp/snapcraft-creds.txtgh secret set SNAPCRAFT_STORE_CREDENTIALS --repo open-cli-collective/jira-ticket-cli < /tmp/snapcraft-creds.txtrm /tmp/snapcraft-creds.txtPart 3: linux-packages Repository Integration
linux-packages-dispatch-jira-ticket-clirepo(full control)gh secret set LINUX_PACKAGES_DISPATCH_TOKEN --repo open-cli-collective/jira-ticket-clilinux-packages/README.mdto add jtk to the Available Packages table:Part 4: Release Workflow Updates
snapjob to.github/workflows/release.yml:linux-packagesjob to.github/workflows/release.yml:Part 5: README Documentation
README.mdwith Linux installation instructions under the Installation section:Snap (recommended)
APT (Debian/Ubuntu)
DNF/YUM (Fedora/RHEL/CentOS)
Binary download
Download
.deb,.rpm, or.tar.gzfrom the Releases page.Part 6: Pre-Release Verification
Verify all secrets are configured:
Expected:
SNAPCRAFT_STORE_CREDENTIALS,LINUX_PACKAGES_DISPATCH_TOKEN(plus existing secrets)Validate GoReleaser config:
goreleaser checkSecrets Checklist
SNAPCRAFT_STORE_CREDENTIALSLINUX_PACKAGES_DISPATCH_TOKENTAP_GITHUB_TOKENCHOCOLATEY_API_KEYWINGET_GITHUB_TOKENFiles to Create/Modify
.goreleaser.ymlnfpmssectionsnap/snapcraft.yaml.github/workflows/release.ymlsnapandlinux-packagesjobsREADME.mdlinux-packages/README.mdReferences