1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: sharp
asset_name: sharp-macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: sharp
asset_name: sharp-macos-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: sharp
asset_name: sharp-linux-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: sharp.exe
asset_name: sharp-windows-x86_64.exe
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install LLVM (macOS)
if: runner.os == 'macOS'
run: |
brew install llvm@18
echo "LLVM_SYS_180_PREFIX=$(brew --prefix llvm@18)" >> $GITHUB_ENV
- name: Install LLVM (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y llvm-18 llvm-18-dev
- name: Install LLVM (Windows)
if: runner.os == 'Windows'
run: |
choco install llvm -y
echo "LLVM_SYS_180_PREFIX=C:\Program Files\LLVM" >> $env:GITHUB_ENV
- name: Build
run: |
cargo build --release --target ${{ matrix.target }}
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
name: ${{ matrix.asset_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}