Skip to content

Commit

Permalink
Merge branch 'VirusTotal:main' into numeric_underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
latonis authored Apr 2, 2024
2 parents a240e1d + 95115e3 commit 62d4d71
Show file tree
Hide file tree
Showing 341 changed files with 4,350 additions and 4,100 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/code_health.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Code health

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.74.0
with:
components: clippy
- run: cargo clippy --tests --no-deps --all-features -- --deny clippy::all
Expand All @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.73.0
- uses: dtolnay/rust-toolchain@1.74.0
with:
components: rustfmt
- run: cargo fmt --all --check
Expand Down
29 changes: 15 additions & 14 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
fail-fast: false
matrix:
go-version: [ '1.19', '1.20', '1.21.x' ]
os: [ubuntu-latest, macos-latest]
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
Expand All @@ -30,7 +30,7 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

# Install OpenSSL on Windows
- name: Install OpenSSL
if: runner.os == 'Windows'
Expand All @@ -52,16 +52,17 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev
- name: Build Rust library
run: cargo build --release -p yara-x -p yara-x-capi

- name: Set LD_LIBRARY_PATH environment variable
if: runner.os == 'Linux'
shell: bash
run: echo "LD_LIBRARY_PATH=${{ github.workspace }}/target/release" >> $GITHUB_ENV

- name: Install cargo-c
run: cargo install cargo-c

- name: Build and install Rust library
run: cargo cinstall -p yara-x-capi --release --pkgconfigdir=${{ github.workspace }} --includedir=${{ github.workspace }} --libdir=${{ github.workspace }}

- name: Run Go tests
run: |
cd go
go test
cd go
go test
env:
PKG_CONFIG_PATH: ${{ github.workspace }}
LD_LIBRARY_PATH: ${{ github.workspace }}
97 changes: 97 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Release
on:
create:
tags:
- 'v*'
jobs:
build:
env:
CARGO_TERM_COLOR: always
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
- linux
- macos
- windows
include:
- build: linux
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
vcpkg_openssl_triplet: x64-linux-release
args: "--features=openssl-static"

- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
vcpkg_openssl_triplet: x64-osx-release
args: "--features=openssl-static"

- build: windows
os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
vcpkg_openssl_triplet: x64-windows-static
args: ""

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install dependencies
id: vcpkg
uses: johnwason/vcpkg-action@v6
with:
pkgs: openssl
triplet: ${{ matrix.vcpkg_openssl_triplet }}
token: ${{ github.token }}

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}

- name: Build
run: cargo build --bin yr --profile release-lto --target ${{ matrix.target }} ${{ matrix.args }}
env:
RUSTFLAGS: "-C target-feature=+crt-static"
OPENSSL_DIR: "${{ github.workspace }}/vcpkg/installed/${{ matrix.vcpkg_openssl_triplet }}"

- name: Build archive
shell: bash
run: |
set -ex
pkgname=yara-x-${{ github.ref_name }}-${{ matrix.target }}
if [ "${{ matrix.build }}" = "windows" ]; then
7z a $pkgname.zip ./target/${{ matrix.target }}/release-lto/yr.exe
else
tar czf $pkgname.gzip -C target/${{ matrix.target }}/release-lto yr
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: yr-${{ matrix.target }}
path: yara-x-*

publish:
needs: [ build ]
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: yr-*

- name: ls
shell: bash
run: ls

- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: yr-*/yara-x-*
Empty file added .github/workflows/site.yaml
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
include:
- build: msrv
os: ubuntu-latest
rust: 1.73.0
rust: 1.74.0
args: "--features=magic-module"

- build: stable
Expand Down
Loading

0 comments on commit 62d4d71

Please sign in to comment.