Skip to content

chore: update README features and optimize CI for binary builds #7

chore: update README features and optimize CI for binary builds

chore: update README features and optimize CI for binary builds #7

Workflow file for this run

name: Build & Release
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: image-diff-linux
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: image-diff-macos
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: image-diff-windows.exe
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build Binary
run: cargo build --release --target ${{ matrix.target }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
target/${{ matrix.target }}/release/image-diff
target/${{ matrix.target }}/release/image-diff.exe
if-no-files-found: ignore
# Optional: Automatic GitHub Release on Tags
release:
name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
image-diff-linux/image-diff
image-diff-macos/image-diff
image-diff-windows.exe/image-diff.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}