-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (77 loc) · 2.37 KB
/
yara.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
name: YARA
on:
workflow_call:
inputs:
runs-on:
description: Runner image
required: true
type: string
version:
description: YARA version
default: 4.3.1
required: false
type: string
outputs:
artifacts:
description: YARA Artifacts
value: ${{ jobs.output.outputs.artifacts }}
include-dir:
description: YARA Includes Directory
value: libyara/include
library-path:
description: YARA Library Path
value: .libs
defaults:
run:
shell: bash
jobs:
yara:
runs-on: ${{ inputs.runs-on }}
steps:
- name: Cache YARA
id: cache-yara
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: yara-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}
path: yara-${{ inputs.version }}
- name: Compile YARA
run: |
#/usr/bin/env bash
set -e
curl -sL \
https://github.com/VirusTotal/yara/archive/refs/tags/v${{ inputs.version }}.tar.gz \
-o yara-${{ inputs.version }}.tar.gz
tar -xzf yara-${{ inputs.version }}.tar.gz
cd yara-${{ inputs.version }}
./bootstrap.sh
./configure
make
if: steps.cache-yara.outputs.cache-hit != 'true' && runner.os == 'Linux'
- name: Upload YARA
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
if-no-files-found: error
name: yara-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}
path: |
yara-${{ inputs.version }}/libyara/include/yara
yara-${{ inputs.version }}/libyara/include/yara.h
yara-${{ inputs.version }}/.libs/libyara*
retention-days: 1
overwrite: true
outputs:
artifacts: yara-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}
output:
needs: yara
runs-on: ubuntu-22.04
steps:
- name: Write Matrix Output
id: write
uses: cloudposse/github-action-matrix-outputs-write@main
with:
matrix-step-name: yara
matrix-key: ${{ inputs.runs-on }}
outputs: |-
artifacts: ${{ needs.yara.outputs.artifacts }}
outputs:
artifacts: ${{ fromJson(steps.write.outputs.result).artifacts }}