Skip to content

Merge pull request #145 from boexler/142-listener-shows-active-in-ui-… #265

Merge pull request #145 from boexler/142-listener-shows-active-in-ui-…

Merge pull request #145 from boexler/142-listener-shows-active-in-ui-… #265

Workflow file for this run

name: Commit
on:
push:
pull_request:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Build solution
run: dotnet build -c Release
- name: Run tests
run: dotnet test -c Release --no-build --verbosity normal
- name: Pack NuGet packages
run: dotnet pack -c Release --no-build -o nuget
- name: Upload nuget packages as artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet
path: nuget
if-no-files-found: error
retention-days: 1
publish-app:
name: Publish Application
needs: [build]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '6.x'
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
- name: Set VERSION environment variable
run: |
$version = "${{ steps.gitversion.outputs.fullSemVer }}"
Add-Content $env:GITHUB_ENV "VERSION=$version"
- name: Normalize version
run: |
$rawVersion = $env:VERSION
$safeVersion = $rawVersion -replace '[^a-zA-Z0-9\.\-]', '_'
Add-Content $env:GITHUB_ENV "SAFE_VERSION=$safeVersion"
- name: Publish Self-Contained
run: |
dotnet publish app/Sentinel.NLogViewer.App/Sentinel.NLogViewer.App.csproj `
-c Release `
-p:SelfContained=true `
-p:PublishSingleFile=true `
-p:RuntimeIdentifier=win-x64 `
-p:Version=$env:VERSION `
-p:IncludeNativeLibrariesForSelfExtract=true `
-o publish/self-contained
- name: Publish Framework-Dependent
run: |
dotnet publish app/Sentinel.NLogViewer.App/Sentinel.NLogViewer.App.csproj `
-c Release `
-p:SelfContained=false `
-p:RuntimeIdentifier=win-x64 `
-p:Version=$env:VERSION `
-o publish/framework-dependent
- name: Rename folders with version
run: |
$version = $env:SAFE_VERSION
Rename-Item -Path "publish/self-contained" -NewName "NLogViewer-SelfContained-win-x64-$version"
Rename-Item -Path "publish/framework-dependent" -NewName "NLogViewer-FrameworkDependent-win-x64-$version"
- name: Upload Self-Contained artifact
uses: actions/upload-artifact@v4
with:
name: NLogViewer-SelfContained-win-x64-${{ env.SAFE_VERSION }}
path: publish/NLogViewer-SelfContained-win-x64-${{ env.SAFE_VERSION }}
if-no-files-found: error
retention-days: 1
- name: Upload Framework-Dependent artifact
uses: actions/upload-artifact@v4
with:
name: NLogViewer-FrameworkDependent-win-x64-${{ env.SAFE_VERSION }}
path: publish/NLogViewer-FrameworkDependent-win-x64-${{ env.SAFE_VERSION }}
if-no-files-found: error
retention-days: 1