Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 56 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
windows:
runs-on: windows-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.101

- name: Restore
run: dotnet restore BindWitness.sln --locked-mode

- name: Verify formatting
run: dotnet format BindWitness.sln --verify-no-changes --no-restore

- name: Build
run: dotnet build BindWitness.sln -c Release --no-restore

- name: Test
run: dotnet test BindWitness.sln -c Release --no-build --logger "trx;LogFileName=tests.trx" --collect "XPlat Code Coverage" --results-directory TestResults

- name: Publish Windows x64
run: dotnet publish src/BindWitness/BindWitness.csproj -c Release -r win-x64 --self-contained true --no-build -o artifacts/win-x64

- name: Smoke test
shell: pwsh
run: |
./artifacts/win-x64/bindwitness.exe --version
$json = ./artifacts/win-x64/bindwitness.exe snapshot --no-firewall 2>$null | ConvertFrom-Json
if ($json.schema_version -ne 1) { throw 'Unexpected snapshot schema.' }

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults/

- name: Upload smoke artifact
uses: actions/upload-artifact@v4
with:
name: bindwitness-win-x64
path: artifacts/win-x64/bindwitness.exe
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
windows:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.101
- name: Restore
run: dotnet restore BindWitness.sln --locked-mode
- name: Verify formatting
run: dotnet format BindWitness.sln --verify-no-changes --no-restore
- name: Build
run: dotnet build BindWitness.sln -c Release --no-restore
- name: Test
run: dotnet test BindWitness.sln -c Release --no-build --logger "trx;LogFileName=tests.trx" --collect "XPlat Code Coverage" --results-directory TestResults
- name: Publish Windows x64
run: dotnet publish src/BindWitness/BindWitness.csproj -c Release -r win-x64 --self-contained true --no-build -o artifacts/win-x64
- name: Smoke test
shell: pwsh
run: |
./artifacts/win-x64/bindwitness.exe --version
$json = ./artifacts/win-x64/bindwitness.exe snapshot --no-firewall 2>$null | ConvertFrom-Json
if ($json.schema_version -ne 1) { throw 'Unexpected snapshot schema.' }
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults/
- name: Upload smoke artifact
uses: actions/upload-artifact@v4
with:
name: bindwitness-win-x64
path: artifacts/win-x64/bindwitness.exe
124 changes: 62 additions & 62 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
name: Release

on:
push:
tags: ['v*']

permissions:
contents: write

jobs:
release:
runs-on: windows-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.101

- name: Restore
run: dotnet restore BindWitness.sln --locked-mode

- name: Verify tag matches project version
shell: pwsh
run: |
$expected = '${{ github.ref_name }}'.TrimStart('v')
$actual = dotnet msbuild src/BindWitness/BindWitness.csproj -getProperty:Version
if ($actual.Trim() -ne $expected) {
throw "Tag version '$expected' does not match project version '$($actual.Trim())'."
}

- name: Test
run: dotnet test BindWitness.sln -c Release --no-restore

- name: Publish
run: dotnet publish src/BindWitness/BindWitness.csproj -c Release -r win-x64 --self-contained true --no-restore -o artifacts/publish

- name: Verify public binary boundary
shell: pwsh
run: |
$files = @(Get-ChildItem artifacts/publish -File)
if ($files.Count -ne 1 -or $files[0].Name -ne 'bindwitness.exe') {
throw "Publish output must contain only bindwitness.exe before public files are added; found: $($files.Name -join ', ')."
}

- name: Package and checksum
shell: pwsh
run: |
New-Item -ItemType Directory -Force artifacts/release | Out-Null
Copy-Item README.md, CHANGELOG.md, LICENSE, SECURITY.md artifacts/publish/
Copy-Item schema artifacts/publish/schema -Recurse
Compress-Archive -Path artifacts/publish/* -DestinationPath artifacts/release/bindwitness-${{ github.ref_name }}-win-x64.zip
$hash = (Get-FileHash artifacts/release/bindwitness-${{ github.ref_name }}-win-x64.zip -Algorithm SHA256).Hash.ToLowerInvariant()
"$hash bindwitness-${{ github.ref_name }}-win-x64.zip" | Set-Content artifacts/release/SHA256SUMS.txt -Encoding ascii

- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
shell: pwsh
run: gh release create "${{ github.ref_name }}" artifacts/release/* --generate-notes --verify-tag
name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.101
- name: Restore
run: dotnet restore BindWitness.sln --locked-mode
- name: Verify tag matches project version
shell: pwsh
run: |
$expected = '${{ github.ref_name }}'.TrimStart('v')
$actual = dotnet msbuild src/BindWitness/BindWitness.csproj -getProperty:Version
if ($actual.Trim() -ne $expected) {
throw "Tag version '$expected' does not match project version '$($actual.Trim())'."
}
- name: Test
run: dotnet test BindWitness.sln -c Release --no-restore
- name: Publish
run: dotnet publish src/BindWitness/BindWitness.csproj -c Release -r win-x64 --self-contained true --no-restore -o artifacts/publish
- name: Verify public binary boundary
shell: pwsh
run: |
$files = @(Get-ChildItem artifacts/publish -File)
if ($files.Count -ne 1 -or $files[0].Name -ne 'bindwitness.exe') {
throw "Publish output must contain only bindwitness.exe before public files are added; found: $($files.Name -join ', ')."
}
- name: Package and checksum
shell: pwsh
run: |
New-Item -ItemType Directory -Force artifacts/release | Out-Null
Copy-Item README.md, CHANGELOG.md, LICENSE, SECURITY.md artifacts/publish/
Copy-Item schema artifacts/publish/schema -Recurse
Compress-Archive -Path artifacts/publish/* -DestinationPath artifacts/release/bindwitness-${{ github.ref_name }}-win-x64.zip
$hash = (Get-FileHash artifacts/release/bindwitness-${{ github.ref_name }}-win-x64.zip -Algorithm SHA256).Hash.ToLowerInvariant()
"$hash bindwitness-${{ github.ref_name }}-win-x64.zip" | Set-Content artifacts/release/SHA256SUMS.txt -Encoding ascii
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
shell: pwsh
run: gh release create "${{ github.ref_name }}" artifacts/release/* --generate-notes --verify-tag
Loading