-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (116 loc) · 4.89 KB
/
Copy pathrelease.yml
File metadata and controls
139 lines (116 loc) · 4.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Release tag, for example v2.12.0'
required: true
type: string
permissions:
contents: write
jobs:
windows-portable-release:
name: Windows portable release
runs-on: windows-latest
env:
PROJECT_PATH: src/ARNetDiscovery.Wpf/ARNetDiscovery.Wpf.csproj
APP_NAME: ARNetDiscovery
PUBLISH_DIR: artifacts/publish/win-x64
ARTIFACT_DIR: artifacts/release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Resolve release version
shell: pwsh
run: |
if ('${{ github.event_name }}' -eq 'push') {
$version = '${{ github.ref_name }}'
}
else {
$version = '${{ github.event.inputs.version }}'
}
if (-not ($version -match '^v\d+\.\d+\.\d+([-.][0-9A-Za-z.-]+)?$')) {
throw "Release version must look like v2.12.0 or v2.12.0-beta.1. Actual: $version"
}
$semver = $version.TrimStart('v')
"RELEASE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
"ASSEMBLY_VERSION=$semver" | Out-File -FilePath $env:GITHUB_ENV -Append
"ZIP_NAME=$($env:APP_NAME)-$version-win-x64-portable.zip" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Restore
run: dotnet restore ARNetDiscovery.sln
- name: Build
run: dotnet build ARNetDiscovery.sln --configuration Release --no-restore
- name: Publish self-contained Windows portable build
shell: pwsh
run: |
dotnet publish $env:PROJECT_PATH `
--configuration Release `
--runtime win-x64 `
--self-contained true `
--output $env:PUBLISH_DIR `
/p:Version=$env:ASSEMBLY_VERSION `
/p:AssemblyVersion=$env:ASSEMBLY_VERSION `
/p:FileVersion=$env:ASSEMBLY_VERSION `
/p:PublishSingleFile=true `
/p:IncludeNativeLibrariesForSelfExtract=true `
/p:IncludeAllContentForSelfExtract=true `
/p:EnableCompressionInSingleFile=true `
/p:DebugType=None `
/p:DebugSymbols=false
- name: Package portable ZIP and checksum
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path $env:ARTIFACT_DIR | Out-Null
$zipPath = Join-Path $env:ARTIFACT_DIR $env:ZIP_NAME
Compress-Archive -Path "$env:PUBLISH_DIR/*" -DestinationPath $zipPath -Force
$hash = Get-FileHash -Algorithm SHA256 $zipPath
$checksumPath = "$zipPath.sha256"
"$($hash.Hash) $($env:ZIP_NAME)" | Set-Content -Path $checksumPath -Encoding ASCII
Get-ChildItem $env:ARTIFACT_DIR | Format-Table Name,Length
- name: Upload workflow artifact
uses: actions/upload-artifact@v4
with:
name: ARNetDiscovery-${{ env.RELEASE_VERSION }}-win-x64-portable
path: artifacts/release/*
if-no-files-found: error
- name: Create GitHub Release
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$notes = @"
## ARNet Discovery $env:RELEASE_VERSION
ARNet Discovery is a portable Windows tool for LAN discovery, imported target-list verification, and lightweight protocol evidence checking.
### What you can do with this release
- Scan the selected laptop adapter with **Scan Local**.
- Probe a known IP address or bounded IP range.
- Import Excel, CSV, or TXT target lists and verify exact expected devices with **Scan List**.
- Review ping, MAC, open-port, protocol, and diagnostic evidence in the device table and inspector.
- Export scan results to CSV for FAT, commissioning, or troubleshooting records.
### How to run
1. Download `$env:ZIP_NAME`.
2. Extract the ZIP to a local folder.
3. Run `ARNetDiscovery.exe`.
4. Select the correct network adapter before scanning.
### Included files
- Portable self-contained Windows x64 application.
- SHA256 checksum file for download verification.
### Safety note
Use this tool only on networks where you are authorized to test. ARNet Discovery provides evidence to support engineering checks; it does not replace formal commissioning, cyber-security, or protection-system procedures.
"@
gh release create $env:RELEASE_VERSION `
"$env:ARTIFACT_DIR/$env:ZIP_NAME" `
"$env:ARTIFACT_DIR/$env:ZIP_NAME.sha256" `
--title "ARNet Discovery $env:RELEASE_VERSION" `
--notes $notes `
--target "${{ github.sha }}" `
--latest