Skip to content

Commit

Permalink
Adding Target for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenfritz committed Oct 25, 2024
1 parent 54b729e commit 783f217
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

# Installiere Rust auf Windows und MinGW-Toolchain
# Installiere Rust auf Windows
- name: Set up Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
target: x86_64-pc-windows-gnu # MinGW-Toolchain hinzufügen
components: rustfmt, clippy

# Cache Rust build
Expand All @@ -54,16 +53,15 @@ jobs:
with:
go-version: '1.23.1'

# Klone YARA-X Repository und baue die C-API mit MinGW
# Klone YARA-X Repository und baue die C-API
- name: Clone YARA-X repository
run: git clone https://github.com/VirusTotal/yara-x.git

- name: Build YARA-X C API and locate .pc file
run: |
cd yara-x
git checkout tags/v0.10.0
rustup target add x86_64-pc-windows-gnu # MinGW-Target hinzufügen
cargo cinstall -p yara-x-capi --release --target=x86_64-pc-windows-gnu --destdir=$env:USERPROFILE\\yara_install
cargo cinstall -p yara-x-capi --release --target=x86_64-pc-windows-msvc --destdir=$env:USERPROFILE\\yara_install
# Suche die .pc Datei und setze den Pfad
$PC_FILE = Get-ChildItem -Recurse -Filter "yara_x_capi.pc" $env:USERPROFILE\\yara_install
if (-not $PC_FILE) {
Expand Down Expand Up @@ -101,25 +99,28 @@ jobs:
cd FileTrove\\cmd\\ftrove
go build -v
# Artefakte-Verzeichnis erstellen
# Artefakte-Verzeichnis erstellen im GITHUB_WORKSPACE
- name: Create artifacts directory
run: New-Item -ItemType Directory -Force -Path ../artifacts
run: New-Item -ItemType Directory -Force -Path $env:GITHUB_WORKSPACE\\artifacts

# Kopiere Artefakte
# Kopiere Artefakte in das Verzeichnis
- name: Copy artifacts
run: |
Copy-Item "$env:USERPROFILE\\yara_install\\lib\\libyara_x_capi*.dll" -Destination ../artifacts
Copy-Item FileTrove\\cmd\\ftrove\\ftrove.exe -Destination ../artifacts
Copy-Item "$env:USERPROFILE\\yara_install\\lib\\libyara_x_capi*.dll" -Destination "$env:GITHUB_WORKSPACE\\artifacts"
Copy-Item "$env:GITHUB_WORKSPACE\\FileTrove\\cmd\\ftrove\\ftrove.exe" -Destination "$env:GITHUB_WORKSPACE\\artifacts"
# Erstelle ein ZIP-Archiv der Artefakte
# Erstelle ein ZIP-Archiv der Artefakte im GITHUB_WORKSPACE
- name: Create archive of artifacts
run: |
cd ../artifacts
Compress-Archive -Path * -DestinationPath windows_x86_64_artifacts.zip
Compress-Archive -Path "$env:GITHUB_WORKSPACE\\artifacts\\*" -DestinationPath "$env:GITHUB_WORKSPACE\\windows_x86_64_artifacts.zip"
if (!(Test-Path -Path "$env:GITHUB_WORKSPACE\\windows_x86_64_artifacts.zip")) {
Write-Error "ZIP archive not found!"
}
# Lade die Artefakte hoch
# Lade das ZIP-Archiv der Artefakte hoch
- name: Upload artifacts
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3.2.1
with:
name: build-artifacts
path: $env:GITHUB_WORKSPACE/windows_x86_64_artifacts.zip
path: $env:GITHUB_WORKSPACE\\windows_x86_64_artifacts.zip

0 comments on commit 783f217

Please sign in to comment.