Skip to content

Update README.md

Update README.md #3

Workflow file for this run

name: Build + Release
on:
push:
branches: [ "main" ]
permissions:
contents: write
concurrency:
group: release-main
cancel-in-progress: false
jobs:
build_and_release:
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: "10.0.x"
- name: Restore
run: dotnet restore .\PCRemoteControlServer.csproj
- name: Publish (win-x64)
run: dotnet publish .\PCRemoteControlServer.csproj -c Release -r win-x64 --self-contained false -o .\artifacts\publish\win-x64
- name: Create zip
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
New-Item -ItemType Directory -Force -Path .\artifacts | Out-Null
$zipPath = Join-Path $PWD 'artifacts\PCRemoteControlServer-win-x64.zip'
if (Test-Path $zipPath) { Remove-Item $zipPath -Force }
Compress-Archive -Path .\artifacts\publish\win-x64\* -DestinationPath $zipPath
- name: Compute tag + release notes (commits since previous release)
id: notes
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
git fetch --tags --force | Out-Null
$latestTag = (git tag --list 'build-*' --sort=-creatordate | Select-Object -First 1)
if ([string]::IsNullOrWhiteSpace($latestTag)) {
$range = ''
} else {
$range = "$latestTag..HEAD"
}
$lines = @()
if ($range -ne '') {
$lines = git log $range --pretty=format:'- %s (%h)'
} else {
$lines = git log -n 50 --pretty=format:'- %s (%h)'
}
if ($lines.Count -eq 0) {
$lines = @('- No changes since the previous build.')
}
$now = Get-Date -Format 'yyyyMMdd-HHmmss'
$tag = "build-$now"
"tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
"latestTag=$latestTag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
$notesFile = Join-Path $PWD 'artifacts\RELEASE_NOTES.md'
@(
"# PCRemoteControlServer $tag"
""
"## Changes"
""
) + $lines | Out-File -FilePath $notesFile -Encoding utf8
"notesFile=$notesFile" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Create GitHub Release + upload asset
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.notes.outputs.tag }}
name: ${{ steps.notes.outputs.tag }}
body_path: ${{ steps.notes.outputs.notesFile }}
files: |
artifacts/PCRemoteControlServer-win-x64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}