54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
name: Build native USB plugin
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'plugins/usb-redir/**'
|
|
- '.github/workflows/native-usb-plugin.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
windows:
|
|
runs-on: windows-latest
|
|
timeout-minutes: 12
|
|
env:
|
|
CGO_ENABLED: '0'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Test and pack the Windows plugin
|
|
shell: pwsh
|
|
run: |
|
|
$cli = Join-Path $env:RUNNER_TEMP 'reims-go-cli.exe'
|
|
$output = Join-Path $env:RUNNER_TEMP 'native-usb-plugin'
|
|
New-Item -ItemType Directory -Path $output | Out-Null
|
|
go test -p 2 ./plugins/usb-redir
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
New-Item -ItemType Directory -Path 'frontend/dist' -Force | Out-Null
|
|
Set-Content -LiteralPath 'frontend/dist/index.html' -Value '<!doctype html>' -Encoding ascii
|
|
go build -p 2 -trimpath -o $cli .
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
$manifest = Get-Content -LiteralPath 'plugins/usb-redir/plugin.json' -Raw | ConvertFrom-Json
|
|
$name = "$($manifest.id)-$($manifest.version).zip"
|
|
& 'plugins/usb-redir/build.ps1' -ReimsGoExe $cli -OutputPath (Join-Path $output $name)
|
|
if (!$?) { exit 1 }
|
|
$hash = (Get-FileHash -LiteralPath (Join-Path $output $name)).Hash.ToLowerInvariant()
|
|
"$hash $name" | Set-Content -LiteralPath (Join-Path $output 'SHA256SUMS.txt') -Encoding ascii
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: native-usb-plugin
|
|
path: ${{ runner.temp }}/native-usb-plugin
|
|
if-no-files-found: error
|