Skip to content
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
98 changes: 98 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,104 @@ jobs:
- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

update-aur:
name: Update AUR package
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Configure SSH for AUR
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
printf '%s\n' "${{ secrets.AUR_SSH_KEY }}" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts 2>/dev/null
cat >> ~/.ssh/config << 'EOF'
Host aur.archlinux.org
IdentityFile ~/.ssh/aur
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Adding IdentitiesOnly yes to the SSH config would be a nice hardening step. Will address in a follow-up.

User aur
StrictHostKeyChecking yes
EOF
Comment on lines +227 to +233
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid point. For now, ssh-keyscan is still better than accept-new since it writes to known_hosts and StrictHostKeyChecking yes ensures subsequent connections verify against it. Pinning a committed fingerprint is a future hardening step — the current risk is limited to the first connection per workflow run.

chmod 600 ~/.ssh/config

- name: Download release assets and compute SHA256
shell: bash
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
TAG="${GITHUB_REF_NAME}"
BASE="https://github.com/felipemorandini/smartlog/releases/download/${TAG}"

curl -fSL --retry 3 "${BASE}/smartlog-x86_64-unknown-linux-musl.tar.gz" -o x86_64.tar.gz
curl -fSL --retry 3 "${BASE}/smartlog-aarch64-unknown-linux-musl.tar.gz" -o aarch64.tar.gz
curl -fSL --retry 3 "https://raw.githubusercontent.com/felipemorandini/smartlog/${TAG}/LICENSE" -o LICENSE

SHA_X86_64=$(sha256sum x86_64.tar.gz | cut -d' ' -f1)
SHA_AARCH64=$(sha256sum aarch64.tar.gz | cut -d' ' -f1)
SHA_LICENSE=$(sha256sum LICENSE | cut -d' ' -f1)

echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
echo "SHA_X86_64=${SHA_X86_64}" >> "$GITHUB_ENV"
echo "SHA_AARCH64=${SHA_AARCH64}" >> "$GITHUB_ENV"
echo "SHA_LICENSE=${SHA_LICENSE}" >> "$GITHUB_ENV"

- name: Clone AUR repo and update PKGBUILD
run: |
git clone ssh://aur@aur.archlinux.org/smartlog-bin.git aur-repo
cp packaging/aur/PKGBUILD aur-repo/PKGBUILD

cd aur-repo

# Update version
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD

# Update checksums
sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${SHA_X86_64}' '${SHA_LICENSE}')/" PKGBUILD
sed -i "s/^sha256sums_aarch64=.*/sha256sums_aarch64=('${SHA_AARCH64}' '${SHA_LICENSE}')/" PKGBUILD

# Remove the SKIP comment if present
sed -i '/^# Update these checksums with: updpkgsums/d' PKGBUILD

# Generate .SRCINFO (makepkg is not available on Ubuntu)
# .SRCINFO uses tab indentation for fields under pkgbase/pkgname
TAB=$'\t'
URL="https://github.com/felipemorandini/smartlog"
{
echo "pkgbase = smartlog-bin"
echo "${TAB}pkgdesc = A high-performance TUI for log tailing with JSON auto-detection and real-time filtering"
echo "${TAB}pkgver = ${VERSION}"
echo "${TAB}pkgrel = 1"
echo "${TAB}url = ${URL}"
echo "${TAB}arch = x86_64"
echo "${TAB}arch = aarch64"
echo "${TAB}license = MIT"
echo "${TAB}provides = smartlog"
echo "${TAB}conflicts = smartlog"
echo "${TAB}source_x86_64 = ${URL}/releases/download/v${VERSION}/smartlog-x86_64-unknown-linux-musl.tar.gz"
echo "${TAB}source_x86_64 = ${URL}/raw/v${VERSION}/LICENSE"
echo "${TAB}sha256sums_x86_64 = ${SHA_X86_64}"
echo "${TAB}sha256sums_x86_64 = ${SHA_LICENSE}"
echo "${TAB}source_aarch64 = ${URL}/releases/download/v${VERSION}/smartlog-aarch64-unknown-linux-musl.tar.gz"
echo "${TAB}source_aarch64 = ${URL}/raw/v${VERSION}/LICENSE"
echo "${TAB}sha256sums_aarch64 = ${SHA_AARCH64}"
echo "${TAB}sha256sums_aarch64 = ${SHA_LICENSE}"
echo ""
echo "pkgname = smartlog-bin"
} > .SRCINFO
Comment on lines +275 to +300
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Known trade-off. makepkg --printsrcinfo requires an Arch Linux container, adding complexity and CI time. The .SRCINFO is generated from the same variables used to update the PKGBUILD, keeping them in sync for all fields that change between releases (version, checksums, sources). For a -bin package with no build dependencies, the static fields (pkgdesc, url, license) change very rarely — when they do, both would need manual updating together. Acceptable risk for now.


- name: Push to AUR
run: |
cd aur-repo
git config user.name "Felipe Pires Morandini"
git config user.email "felipepiresmorandini@gmail.com"
git add PKGBUILD .SRCINFO
git diff --cached --quiet && echo "No changes to push" && exit 0
git commit -m "Update to v${VERSION}"
git push

update-homebrew:
name: Update Homebrew formula
needs: release
Expand Down
95 changes: 47 additions & 48 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,50 @@

## Phase 6: Distribution & Polish

### 6.1 Shell Completions
- **Priority:** High
- **Effort:** Small
- Add `clap_complete` dependency
- Add `completions <SHELL>` subcommand (bash, zsh, fish, elvish, powershell)
- Document in README with setup instructions per shell
- Reference: jwt-term already implements this pattern

### 6.2 AUR Package (Arch Linux)
- **Priority:** Medium
- **Effort:** Small
- Create a `PKGBUILD` that downloads the pre-built Linux binary from GitHub Releases
- Submit to the AUR as `smartlog`
- Add AUR install instructions to README
- Consider a `-bin` suffix (`smartlog-bin`) if a source-build variant is also desired

### 6.3 Winget Manifest (Windows)
- **Priority:** Medium
- **Effort:** Small
- Create a manifest pointing to the `smartlog-x86_64-pc-windows-msvc.zip` release asset
- Submit PR to [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs)
- Add `winget install smartlog` instructions to README
- Optionally automate manifest updates via [wingetcreate](https://github.com/microsoft/winget-create) in the release workflow

### 6.4 CHANGELOG.md
- **Priority:** Medium
- **Effort:** Small
- Create a `CHANGELOG.md` following [Keep a Changelog](https://keepachangelog.com) format
- Backfill entries for v0.1.0 through v0.5.0 from git history / release notes
- Update with each new release going forward

### 6.5 Debian Package (.deb)
- **Priority:** Low
- **Effort:** Medium
- Add `[package.metadata.deb]` section to `Cargo.toml` with description, section, and assets
- Add `cargo-deb` step to the release workflow (build `.deb` for x86_64 and aarch64 Linux targets)
- Attach `.deb` files to GitHub Releases
- Add install instructions to README (`sudo dpkg -i smartlog_*.deb`)

## Suggested Order

| Order | Item | Reason |
|-------|------|--------|
| 1 | 6.1 Shell Completions | Direct UX improvement, parity with jwt-term |
| 2 | 6.4 CHANGELOG.md | Low effort, good practice for all subsequent releases |
| 3 | 6.2 AUR Package | Large Rust-savvy audience on Arch |
| 4 | 6.3 Winget Manifest | Covers Windows users who prefer package managers |
| 5 | 6.5 Debian Package | Broader Linux reach, but more CI complexity |
### 6.1 Shell Completions — DONE
- [x] Add `clap_complete` dependency
- [x] Add `completions <SHELL>` subcommand (bash, zsh, fish, elvish, powershell)
- [x] Document in README with setup instructions per shell

### 6.2 AUR Package (Arch Linux) — DONE
- [x] Create a `PKGBUILD` that downloads the pre-built Linux binary from GitHub Releases
- [x] Add AUR install instructions to README
- [x] Use `-bin` suffix (`smartlog-bin`)
- [x] Register `smartlog-bin` on the AUR and push initial PKGBUILD
- [x] Automate AUR updates in the release workflow (`update-aur` job in `release.yml`)

### 6.3 Winget Manifest (Windows) — PARTIALLY DONE
- [x] Create a manifest (v1.6.0 schema) pointing to the GitHub Release `.zip` assets
- [x] Add `winget install` instructions to README
- [ ] Compute real SHA256 hashes for current release assets
- [ ] Submit initial PR to [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs)
- [ ] Automate manifest updates via [wingetcreate](https://github.com/microsoft/winget-create) in the release workflow

### 6.4 CHANGELOG.md — DONE
- [x] Create a `CHANGELOG.md` following [Keep a Changelog](https://keepachangelog.com) format
- [x] Backfill entries for v0.1.0 through v0.6.0 from git history / release notes
- [x] Update with each new release going forward

### 6.5 Debian Package (.deb) — DONE
- [x] Add `[package.metadata.deb]` section to `Cargo.toml`
- [x] Add `cargo-deb` step to the release workflow (build `.deb` for x86_64 and aarch64 Linux targets)
- [x] Attach `.deb` files to GitHub Releases automatically
- [x] Add install instructions to README

## Remaining Work

| Priority | Item | Effort | Description |
|----------|------|--------|-------------|
| Medium | Winget submission | Small | Compute checksums, submit initial PR to winget-pkgs |
| Medium | Winget automation | Medium | Add `wingetcreate` step to release workflow for auto-submission |

## Completed Distribution Channels

| Channel | Automated? | Notes |
|---------|-----------|-------|
| GitHub Releases (6 targets) | Yes | Triggered by version tag |
| Homebrew (macOS & Linux) | Yes | Formula auto-updated on release |
| crates.io | Yes | Published on release |
| Debian .deb (x86_64 + ARM64) | Yes | Built and attached to release |
| AUR (Arch Linux) | Yes | `update-aur` job in release.yml, `AUR_SSH_KEY` secret configured |
| Winget (Windows) | No | Template in `packaging/winget/`, manual submission |
2 changes: 1 addition & 1 deletion packaging/aur/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/felipemorandini/smartlog

pkgname=smartlog-bin
pkgver=0.5.0
pkgver=0.6.0
pkgrel=1
pkgdesc="A high-performance TUI for log tailing with JSON auto-detection and real-time filtering"
arch=('x86_64' 'aarch64')
Expand Down
Loading