Skip to content

Commit 2e5a899

Browse files
4cecoderclaude
andcommitted
Add CI/CD workflows, versioning, assets, and changelog
GitHub Actions: - .github/workflows/ci.yml - Build & test on push/PR (Linux, macOS, Windows) - .github/workflows/release.yml - Auto-release on tag with multi-platform binaries Versioning: - scripts/bump-version.sh - Automated version bump across all packaging files - CHANGELOG.md - Keep a Changelog format Assets: - assets/logo.svg - Project logo (512x512) - assets/social-preview.svg - Twitter/OpenGraph card (1280x640) README: - Added CI, Release, License, Zig badges - Centered header with quick navigation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c93066c commit 2e5a899

7 files changed

Lines changed: 573 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
name: Build & Test
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Zig
23+
uses: goto-bus-stop/setup-zig@v2
24+
with:
25+
version: 0.13.0
26+
27+
- name: Build (Debug)
28+
run: zig build
29+
30+
- name: Build (Release)
31+
run: zig build -Doptimize=ReleaseSafe
32+
33+
- name: Test help command
34+
shell: bash
35+
run: ./zig-out/bin/imtools help
36+
37+
- name: Test dry-run commands
38+
shell: bash
39+
run: |
40+
mkdir -p test-dir
41+
cd test-dir
42+
../zig-out/bin/imtools flatten --dry-run
43+
../zig-out/bin/imtools find-duplicates
44+
../zig-out/bin/imtools delete-portrait --dry-run
45+
../zig-out/bin/imtools remove-empty-dirs --dry-run
46+
47+
lint:
48+
name: Format Check
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
54+
- name: Setup Zig
55+
uses: goto-bus-stop/setup-zig@v2
56+
with:
57+
version: 0.13.0
58+
59+
- name: Check formatting
60+
run: zig fmt --check src/main.zig

.github/workflows/release.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build ${{ matrix.name }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- name: linux-x86_64
20+
os: ubuntu-latest
21+
target: x86_64-linux-musl
22+
artifact: imtools
23+
archive: tar.gz
24+
- name: linux-aarch64
25+
os: ubuntu-latest
26+
target: aarch64-linux-musl
27+
artifact: imtools
28+
archive: tar.gz
29+
- name: macos-x86_64
30+
os: macos-latest
31+
target: x86_64-macos
32+
artifact: imtools
33+
archive: tar.gz
34+
- name: macos-aarch64
35+
os: macos-latest
36+
target: aarch64-macos
37+
artifact: imtools
38+
archive: tar.gz
39+
- name: windows-x86_64
40+
os: windows-latest
41+
target: x86_64-windows
42+
artifact: imtools.exe
43+
archive: zip
44+
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
49+
- name: Setup Zig
50+
uses: goto-bus-stop/setup-zig@v2
51+
with:
52+
version: 0.13.0
53+
54+
- name: Build
55+
run: zig build -Doptimize=ReleaseSafe -Dtarget=${{ matrix.target }}
56+
57+
- name: Create release directory
58+
shell: bash
59+
run: |
60+
VERSION=${GITHUB_REF#refs/tags/v}
61+
mkdir -p release
62+
cp zig-out/bin/${{ matrix.artifact }} release/
63+
cp README.md LICENSE release/
64+
cp -r docs release/
65+
66+
- name: Create tarball (Unix)
67+
if: matrix.archive == 'tar.gz'
68+
shell: bash
69+
run: |
70+
VERSION=${GITHUB_REF#refs/tags/v}
71+
cd release
72+
tar -czvf ../imtools-${VERSION}-${{ matrix.name }}.tar.gz *
73+
74+
- name: Create zip (Windows)
75+
if: matrix.archive == 'zip'
76+
shell: pwsh
77+
run: |
78+
$VERSION = $env:GITHUB_REF -replace 'refs/tags/v', ''
79+
Compress-Archive -Path release/* -DestinationPath "imtools-${VERSION}-${{ matrix.name }}.zip"
80+
81+
- name: Upload artifact
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: imtools-${{ matrix.name }}
85+
path: imtools-*.${{ matrix.archive }}
86+
87+
# Build AppImage
88+
appimage:
89+
name: Build AppImage
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Checkout
93+
uses: actions/checkout@v4
94+
95+
- name: Setup Zig
96+
uses: goto-bus-stop/setup-zig@v2
97+
with:
98+
version: 0.13.0
99+
100+
- name: Build AppImage
101+
run: |
102+
VERSION=${GITHUB_REF#refs/tags/v}
103+
cd packaging/appimage
104+
VERSION=$VERSION ./build-appimage.sh
105+
106+
- name: Upload artifact
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: imtools-appimage
110+
path: build-appimage/*.AppImage
111+
112+
release:
113+
name: Create Release
114+
needs: [build, appimage]
115+
runs-on: ubuntu-latest
116+
steps:
117+
- name: Checkout
118+
uses: actions/checkout@v4
119+
120+
- name: Download all artifacts
121+
uses: actions/download-artifact@v4
122+
with:
123+
path: artifacts
124+
125+
- name: Generate checksums
126+
run: |
127+
cd artifacts
128+
find . -type f \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.AppImage" \) -exec sha256sum {} \; > checksums.txt
129+
cat checksums.txt
130+
131+
- name: Get version
132+
id: version
133+
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
134+
135+
- name: Create Release
136+
uses: softprops/action-gh-release@v2
137+
with:
138+
name: imtools ${{ steps.version.outputs.version }}
139+
draft: false
140+
prerelease: false
141+
generate_release_notes: true
142+
files: |
143+
artifacts/**/*.tar.gz
144+
artifacts/**/*.zip
145+
artifacts/**/*.AppImage
146+
artifacts/checksums.txt

CHANGELOG.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.0.0] - 2024-12-15
11+
12+
### Added
13+
14+
- **Core Commands**
15+
- `flatten` - Move images from nested subdirectories to current directory
16+
- `find-duplicates` - Find duplicate images by SHA256 hash with optional deletion
17+
- `delete-portrait` - Delete portrait-oriented images (height > width)
18+
- `remove-empty-dirs` - Recursively remove empty directories
19+
- `convert-to-png` - Batch convert images to PNG format (requires ffmpeg)
20+
21+
- **Download Command**
22+
- Download wallpapers from wallhaven.cc
23+
- Automatic JPG to PNG conversion
24+
- Configurable search query and limit
25+
26+
- **AI-Powered Sorting**
27+
- Local AI image categorization via Ollama vision models
28+
- 50+ auto-detected categories (nature, anime, space, etc.)
29+
- Custom category support
30+
- Parallel processing with configurable workers
31+
32+
- **Image Format Support**
33+
- Native header parsing for PNG, JPEG, GIF, BMP, WebP
34+
- Basic TIFF support
35+
- No external libraries required for dimension detection
36+
37+
- **Packaging**
38+
- Gentoo ebuilds (stable + live)
39+
- Arch Linux PKGBUILD (AUR-ready)
40+
- Debian/Ubuntu .deb packaging
41+
- Fedora/RHEL RPM spec
42+
- Alpine APKBUILD
43+
- NixOS flake + default.nix
44+
- Flatpak manifest
45+
- Snap package
46+
- AppImage build script
47+
- Homebrew formula (macOS)
48+
- Scoop manifest (Windows)
49+
- Chocolatey package (Windows)
50+
51+
- **Documentation**
52+
- Comprehensive README with quick start guide
53+
- Installation guide for all platforms
54+
- Complete command reference
55+
- AI sorting setup guide
56+
- Architecture & contributing guide
57+
- Packaging guide for maintainers
58+
59+
### Technical
60+
61+
- Single-file Zig implementation (~1900 lines)
62+
- Zero runtime dependencies for core features
63+
- Cross-platform (Linux, macOS, Windows)
64+
- Static binary builds via musl
65+
66+
[Unreleased]: https://github.com/4cecoder/imtools/compare/v1.0.0...HEAD
67+
[1.0.0]: https://github.com/4cecoder/imtools/releases/tag/v1.0.0

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
<div align="center">
2+
13
# imtools
24

5+
[![CI](https://github.com/4cecoder/imtools/actions/workflows/ci.yml/badge.svg)](https://github.com/4cecoder/imtools/actions/workflows/ci.yml)
6+
[![Release](https://img.shields.io/github/v/release/4cecoder/imtools?include_prereleases)](https://github.com/4cecoder/imtools/releases)
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8+
[![Zig](https://img.shields.io/badge/Zig-0.13+-f7a41d?logo=zig&logoColor=white)](https://ziglang.org)
9+
10+
**Fast image manipulation CLI written in Zig**
11+
12+
[Features](#features)[Install](#quick-start)[Commands](#commands)[Docs](#documentation)
13+
14+
</div>
15+
16+
---
17+
318
A fast, standalone CLI tool for image and wallpaper management. Written in Zig with zero runtime dependencies for core operations.
419

520
```bash

assets/logo.svg

Lines changed: 37 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)