-
Notifications
You must be signed in to change notification settings - Fork 29
66 lines (63 loc) · 1.97 KB
/
bindings.yaml
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
name: bindings
on:
push:
paths:
- .github/workflows/bindings.yaml
- yara-sys/yara
- yara-sys/Cargo.toml
- yara-sys/build.rs
- yara-sys/wrapper.h
pull_request:
paths:
- .github/workflows/bindings.yaml
- yara-sys/yara
- yara-sys/Cargo.toml
- yara-sys/build.rs
- yara-sys/wrapper.h
jobs:
x86_64_bindings:
strategy:
matrix:
include:
- os: "ubuntu-latest"
target: "x86_64-unknown-linux-gnu"
- os: "ubuntu-latest"
target: "x86_64-unknown-linux-musl"
- os: "windows-latest"
target: "x86_64-pc-windows-msvc"
- os: "windows-latest"
target: "x86_64-pc-windows-gnu"
- os: "macos-latest"
target: "x86_64-apple-darwin"
runs-on: ${{ matrix.os }}
steps:
# required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
if: matrix.os == 'windows-latest'
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
if: matrix.os == 'windows-latest'
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
- uses: actions/checkout@v3
with:
submodules: true
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Generate bindings
shell: bash
run: |
cargo build --verbose --no-default-features --features vendored,bindgen
mkdir out
find . -name 'bindings.rs'
cp "$(find . -name 'bindings.rs')" "./out/yara-${{ matrix.target }}.rs"
ls out
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
path: ./out/yara-${{ matrix.target }}.rs