Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(yara): overwrite the artifact when uploading #105

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/yara.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: YARA

on:
Expand All @@ -9,7 +10,7 @@ on:
type: string
version:
description: YARA version
default: "4.3.1"
default: 4.3.1
required: false
type: string
outputs:
Expand All @@ -23,26 +24,38 @@ on:
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@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
key: yara-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}
path: yara-${{ inputs.version }}

- name: Compile YARA
if: steps.cache-yara.outputs.cache-hit != 'true' && runner.os == 'Linux'
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

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@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
if-no-files-found: error
name: yara-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}
Expand All @@ -51,6 +64,7 @@ jobs:
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 }}
Expand Down
Loading