This PR brings a big overhaul to oxipng's help, with new long form
descriptions of many options.
The full output (--help) is added as a text file MANUAL.txt. Critiques
welcome.
The short output (-h) is simplified and appears as follows:
```
Losslessly improve compression of PNG files
Usage: oxipng [OPTIONS] <files>...
Arguments:
<files>... File(s) to compress (use '-' for stdin)
Options:
-o, --opt <level> Optimization level (0-6, or max) [default: 2]
-r, --recursive Recurse input directories, optimizing all PNG files
--dir <directory> Write output file(s) to <directory>
--out <file> Write output file to <file>
--stdout Write output to stdout
-p, --preserve Preserve file permissions and timestamps if possible
-P, --pretend Do not write any files, only show compression results
-s Strip safely-removable chunks, same as '--strip safe'
--strip <mode> Strip metadata (safe, all, or comma-separated list)
CAUTION: 'all' will convert APNGs to standard PNGs
--keep <list> Strip all metadata except in the comma-separated list
-a, --alpha Perform additional alpha channel optimization
-i, --interlace <type> Set PNG interlacing type (0, 1, keep) [default: 0]
--scale16 Forcibly reduce 16-bit images to 8-bit (lossy)
-v, --verbose... Run in verbose mode (use twice to increase verbosity)
-q, --quiet Run in quiet mode
-f, --filters <list> Filters to try (0-9; see '--help' for details)
--fast Use fast filter evaluation
--zc <level> Deflate compression level (1-12)
--nb Do not change bit depth
--nc Do not change color type
--np Do not change color palette
--ng Do not change to or from grayscale
--nx Do not perform any transformations
--nz Do not recompress unless transformations occur
--fix Disable checksum validation
--force Write the output even if it is larger than the input
-Z, --zopfli Use the much slower but stronger Zopfli compressor
--timeout <secs> Maximum amount of time to spend on optimizations
-t, --threads <num> Set number of threads to use [default: num CPU cores]
-h, --help Print help (see more with '--help')
-V, --version Print version
Run `oxipng --help` to see full details of all options
```
---------
Co-authored-by: Alejandro González <me@alegon.dev>
83 lines
2.2 KiB
YAML
83 lines
2.2 KiB
YAML
name: deploy
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
permissions:
|
|
actions: read
|
|
contents: write
|
|
|
|
jobs:
|
|
deploy:
|
|
name: Deploy release
|
|
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
|
|
# Prevent job from running on forks
|
|
if: ${{ !github.event.repository.fork }}
|
|
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- x86_64-unknown-linux-gnu
|
|
- x86_64-unknown-linux-musl
|
|
- aarch64-unknown-linux-gnu
|
|
- aarch64-unknown-linux-musl
|
|
- x86_64-pc-windows-msvc
|
|
- i686-pc-windows-msvc
|
|
- x86_64-apple-darwin
|
|
- aarch64-apple-darwin
|
|
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get the Oxipng version
|
|
id: oxipngMeta
|
|
run: echo "version=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "oxipng").version')"
|
|
>> "$GITHUB_OUTPUT"
|
|
|
|
- name: Retrieve ${{ matrix.target }} binary
|
|
uses: dawidd6/action-download-artifact@v2
|
|
with:
|
|
workflow: oxipng.yml
|
|
commit: ${{ env.GITHUB_SHA }}
|
|
name: Oxipng binary (${{ matrix.target }})
|
|
path: target
|
|
|
|
- name: Generate up to date manual
|
|
run: scripts/manual.sh
|
|
|
|
- name: Build archives
|
|
working-directory: target
|
|
run: |
|
|
ARCHIVE_NAME="oxipng-${{ steps.oxipngMeta.outputs.version }}-${{ matrix.target }}"
|
|
|
|
mkdir "$ARCHIVE_NAME"
|
|
cp ../CHANGELOG.md ../README.md ../MANUAL.txt "$ARCHIVE_NAME"
|
|
|
|
case '${{ matrix.target }}' in
|
|
*-windows-*)
|
|
cp ../LICENSE "$ARCHIVE_NAME/LICENSE.txt"
|
|
cp oxipng.exe "$ARCHIVE_NAME"
|
|
zip "${ARCHIVE_NAME}.zip" "$ARCHIVE_NAME"/*;;
|
|
*)
|
|
cp ../LICENSE "$ARCHIVE_NAME"
|
|
cp oxipng "$ARCHIVE_NAME"
|
|
tar -vczf "${ARCHIVE_NAME}.tar.gz" "$ARCHIVE_NAME"/*;;
|
|
esac
|
|
|
|
- name: Create release notes
|
|
run: tail -n +2 CHANGELOG.md | sed -e '/^$/,$d' > RELEASE_NOTES.txt
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
name: v${{ steps.oxipngMeta.outputs.version }}
|
|
body_path: RELEASE_NOTES.txt
|
|
files: |
|
|
target/*.zip
|
|
target/*.tar.gz
|