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
55 changes: 55 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,56 @@ permissions:
id-token: write

jobs:
# ─────────────────────────────────────────────
# Check if versions are already published
# ─────────────────────────────────────────────
check-versions:
name: Check published versions
runs-on: ubuntu-latest
outputs:
crates-published: ${{ steps.check.outputs.crates }}
maven-published: ${{ steps.check.outputs.maven }}
pypi-published: ${{ steps.check.outputs.pypi }}
steps:
- id: check
run: |
RELEASE_VERSION="${VERSION#v}"

# Check crates.io
if curl -sf "https://crates.io/api/v1/crates/slimg/$RELEASE_VERSION" > /dev/null 2>&1; then
echo "crates=true" >> $GITHUB_OUTPUT
echo "✅ crates.io: slimg@$RELEASE_VERSION already published"
else
echo "crates=false" >> $GITHUB_OUTPUT
echo "⏳ crates.io: slimg@$RELEASE_VERSION not found, will publish"
fi

# Check Maven Central
MAVEN_URL="https://repo1.maven.org/maven2/io/clroot/slimg/slimg-kotlin/$RELEASE_VERSION/slimg-kotlin-$RELEASE_VERSION.pom"
if curl -sf "$MAVEN_URL" > /dev/null 2>&1; then
echo "maven=true" >> $GITHUB_OUTPUT
echo "✅ Maven Central: slimg-kotlin@$RELEASE_VERSION already published"
else
echo "maven=false" >> $GITHUB_OUTPUT
echo "⏳ Maven Central: slimg-kotlin@$RELEASE_VERSION not found, will publish"
fi

# Check PyPI
if curl -sf "https://pypi.org/pypi/slimg/$RELEASE_VERSION/json" > /dev/null 2>&1; then
echo "pypi=true" >> $GITHUB_OUTPUT
echo "✅ PyPI: slimg@$RELEASE_VERSION already published"
else
echo "pypi=false" >> $GITHUB_OUTPUT
echo "⏳ PyPI: slimg@$RELEASE_VERSION not found, will publish"
fi

# ─────────────────────────────────────────────
# Publish to crates.io (slimg-core → slimg)
# ─────────────────────────────────────────────
publish-crates:
name: Publish to crates.io
needs: [check-versions]
if: needs.check-versions.outputs.crates-published != 'true'
runs-on: ubuntu-latest
env:
SYSTEM_DEPS_DAV1D_BUILD_INTERNAL: always
Expand Down Expand Up @@ -126,6 +171,8 @@ jobs:
# ─────────────────────────────────────────────
build-kotlin-native:
name: Build native (${{ matrix.target }})
needs: [check-versions]
if: needs.check-versions.outputs.maven-published != 'true'
runs-on: ${{ matrix.runner }}
env:
SYSTEM_DEPS_DAV1D_BUILD_INTERNAL: always
Expand Down Expand Up @@ -209,6 +256,8 @@ jobs:
# ─────────────────────────────────────────────
generate-kotlin-bindings:
name: Generate Kotlin bindings
needs: [check-versions]
if: needs.check-versions.outputs.maven-published != 'true'
runs-on: macos-latest
env:
SYSTEM_DEPS_DAV1D_BUILD_INTERNAL: always
Expand Down Expand Up @@ -322,6 +371,8 @@ jobs:
# ─────────────────────────────────────────────
build-python-wheels:
name: Build Python wheel (${{ matrix.target }})
needs: [check-versions]
if: needs.check-versions.outputs.pypi-published != 'true'
runs-on: ${{ matrix.runner }}
env:
SYSTEM_DEPS_DAV1D_BUILD_INTERNAL: always
Expand Down Expand Up @@ -385,6 +436,8 @@ jobs:
# ─────────────────────────────────────────────
build-python-sdist:
name: Build Python sdist
needs: [check-versions]
if: needs.check-versions.outputs.pypi-published != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -406,6 +459,8 @@ jobs:
# ─────────────────────────────────────────────
verify-python-version:
name: Verify Python package version
needs: [check-versions]
if: needs.check-versions.outputs.pypi-published != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
| JPEG | O | O | MozJPEG 인코더로 뛰어난 압축률 |
| PNG | O | O | OxiPNG + Zopfli 압축 |
| WebP | O | O | libwebp 기반 손실 압축 |
| AVIF | macOS만 | O | ravif 인코더 (AV1 기반); 디코딩에 dav1d 필요 (macOS Homebrew) |
| AVIF | O | O | ravif 인코더; dav1d 디코더 (정적 링크) |
| QOI | O | O | 무손실, 빠른 인코딩/디코딩 |
| JPEG XL | O | X | 디코딩만 지원 (GPL 라이선스 제한) |
| JPEG XL | O | O | libjxl 인코더/디코더 |

## 설치

Expand Down Expand Up @@ -54,7 +54,8 @@ cargo install --path cli
- Rust 1.85+ (edition 2024)
- C 컴파일러 (cc)
- nasm (MozJPEG / rav1e 어셈블리 최적화용)
- dav1d (macOS만, AVIF 디코딩용)
- meson + ninja (dav1d AVIF 디코더 소스 빌드용)
- `SYSTEM_DEPS_DAV1D_BUILD_INTERNAL=always` 설정으로 dav1d를 소스에서 빌드
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This list item reads like an instruction. To maintain consistency with the other requirements in the list (which are nouns like 'C compiler'), it would be clearer to phrase this as a requirement as well.

Suggested change
- `SYSTEM_DEPS_DAV1D_BUILD_INTERNAL=always` 설정으로 dav1d를 소스에서 빌드
- `SYSTEM_DEPS_DAV1D_BUILD_INTERNAL=always` 환경 변수 (dav1d 소스 빌드용)


## 사용법

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A fast image optimization CLI. Convert, compress, resize, crop, and extend image
| WebP | Yes | Yes | Lossy encoding via libwebp |
| AVIF | Yes | Yes | ravif encoder; dav1d decoder (statically linked) |
| QOI | Yes | Yes | Lossless, fast encode/decode |
| JPEG XL| Yes | No | Decode-only (GPL license restriction) |
| JPEG XL| Yes | Yes | libjxl encoder/decoder |

## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/usage.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ slimg convert photo.jpg --format webp

| 옵션 | 설명 |
|------|------|
| `--format`, `-f` | 대상 포맷: `jpeg`, `png`, `webp`, `avif`, `qoi` |
| `--format`, `-f` | 대상 포맷: `jpeg`, `png`, `webp`, `avif`, `jxl`, `qoi` |
| `--quality`, `-q` | 인코딩 품질 0-100 (기본값: 80) |
| `--output`, `-o` | 출력 경로 (파일 또는 디렉토리) |
| `--recursive` | 하위 디렉토리 포함 처리 |
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ slimg convert photo.jpg --format webp

| Option | Description |
|--------|-------------|
| `--format`, `-f` | Target format: `jpeg`, `png`, `webp`, `avif`, `qoi` |
| `--format`, `-f` | Target format: `jpeg`, `png`, `webp`, `avif`, `jxl`, `qoi` |
| `--quality`, `-q` | Encoding quality 0-100 (default: 80) |
| `--output`, `-o` | Output path (file or directory) |
| `--recursive` | Process subdirectories |
Expand Down