Embedded PS1 scripts into the workflow

This commit is contained in:
The Artifex (4r7if3x) 2023-06-07 11:16:44 +02:00
parent 5158158369
commit bacd8d183d
No known key found for this signature in database
GPG key ID: F23C261322667A12
4 changed files with 27 additions and 36 deletions

View file

@ -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

View file

@ -51,7 +51,24 @@ jobs:
- name: Install dependencies
if: ${{ matrix.os == 'windows' }}
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 "${{ secrets.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
@ -264,7 +281,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

View file

@ -1,25 +0,0 @@
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidateSet("amd64", "i386", "arm64")]
[string]$ARCH,
[Parameter(Mandatory)]
[string]$OEM
)
Write-Host "::group::Npcap SDK"
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)
{
"amd64" { "Lib\\x64" }
"i386" { "Lib" }
"arm64" { "Lib\\ARM64" }
}
Add-Content -Path "$env:GITHUB_ENV" -Value "LIB=$env:TEMP\\npcap-sdk\\$LibPath"
Write-Host "::endgroup::"
Write-Host "::group::Npcap DLL"
Invoke-WebRequest -Uri "$OEM" -OutFile "$env:TEMP\\npcap-oem.exe" -Verbose
Start-Process -FilePath "$env:TEMP\\npcap-oem.exe" -ArgumentList "/S" -Wait
Write-Host "::endgroup::"

View file

@ -1,5 +0,0 @@
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::"