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

Fixed build and packaging issues #246

Merged
merged 12 commits into from
Jun 7, 2023
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{ps1,rtf}]
[*.rtf]
end_of_line = crlf

[*.ps1]
indent_style = tab

[{.gitignore,*.desktop}]
indent_size = 0

Expand Down
41 changes: 31 additions & 10 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
name: Package

on:
workflow_dispatch:
push:
secrets:
NPCAP_OEM_URL:
required: true
workflow_call:
secrets:
NPCAP_OEM_URL:
required: true
tags:
- v*
workflow_dispatch:

jobs:

Expand Down Expand Up @@ -50,8 +45,27 @@ jobs:

- name: Install dependencies
if: ${{ matrix.os == 'windows' }}
env:
NPCAP_OEM_URL: ${{ secrets.NPCAP_OEM_URL }}
shell: powershell
run: .\resources\packaging\windows\scripts\npcap.ps1 -ARCH ${{ matrix.arch }} -OEM "${{ secrets.NPCAP_OEM_URL }}"
run: |
Write-Host "::group::Npcap SDK"
$ARCH = "${{ matrix.arch }}"
Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "$env:TEMP\npcap-sdk.zip" -Verbose
Expand-Archive -LiteralPath "$env:TEMP\npcap-sdk.zip" -DestinationPath "$env:TEMP\npcap-sdk" -Verbose
$LibPath = switch ($ARCH)
{
"i386" { "Lib" }
"amd64" { "Lib\x64" }
"arm64" { "Lib\ARM64" }
default { throw "$ARCH is not supported!" }
}
Add-Content -Path "$env:GITHUB_ENV" -Value "LIB=$env:TEMP\npcap-sdk\$LibPath"
Write-Host "::endgroup::"
Write-Host "::group::Npcap DLL"
Invoke-WebRequest -Uri "$env:NPCAP_OEM_URL" -OutFile "$env:TEMP\npcap-oem.exe" -Verbose
Start-Process -FilePath "$env:TEMP\npcap-oem.exe" -ArgumentList "/S" -Wait
Write-Host "::endgroup::"

- name: Install Rust
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -264,7 +278,14 @@ jobs:

- name: Install dependencies
shell: powershell
run: .\resources\packaging\windows\scripts\wix.ps1
run: |
Write-Host "::group::WiX Toolset"
Invoke-WebRequest `
-Uri "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip" `
-OutFile "$env:TEMP\wix-binaries.zip" -Verbose
Expand-Archive -LiteralPath "$env:TEMP\wix-binaries.zip" -DestinationPath "$env:TEMP\wix" -Verbose
Set-Item -Path env:Path -Value "$env:Path;$env:TEMP\wix"
Write-Host "::endgroup::"

- name: Install Rust
uses: actions-rs/toolchain@v1
Expand Down
25 changes: 0 additions & 25 deletions resources/packaging/windows/scripts/npcap.ps1

This file was deleted.

5 changes: 0 additions & 5 deletions resources/packaging/windows/scripts/wix.ps1

This file was deleted.