Skip to content

Add Azure Trusted Signing to build workflow #22

Add Azure Trusted Signing to build workflow

Add Azure Trusted Signing to build workflow #22

Workflow file for this run

name: Build Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore WindowsEdgeLight/WindowsEdgeLight.csproj
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: '6.4.x'
- name: GitVersion
uses: gittools/actions/gitversion/execute@v4
id: gitversion
- name: Set version environment variables
shell: pwsh
run: |
# Use GitVersion outputs for all versioning
$version = '${{ steps.gitversion.outputs.semVer }}'
$fullVersion = '${{ steps.gitversion.outputs.fullSemVer }}'
# Assembly version must be 4-part (x.y.z.w)
$assemblyVersion = "${{ steps.gitversion.outputs.major }}.${{ steps.gitversion.outputs.minor }}.${{ steps.gitversion.outputs.patch }}.0"
Write-Host "Using semantic version: $version"
Write-Host "Using full version: $fullVersion"
Write-Host "Using assembly version: $assemblyVersion"
echo "VERSION=$version" >> $env:GITHUB_ENV
echo "FULLVERSION=$fullVersion" >> $env:GITHUB_ENV
echo "ASSEMBLY_VERSION=$assemblyVersion" >> $env:GITHUB_ENV
- name: Build x64
run: |
dotnet publish WindowsEdgeLight/WindowsEdgeLight.csproj `
-c Release `
-r win-x64 `
/p:DebugType=None `
/p:DebugSymbols=false `
/p:Version=$env:VERSION `
/p:AssemblyVersion=$env:ASSEMBLY_VERSION `
/p:FileVersion=$env:ASSEMBLY_VERSION `
/p:AssemblyInformationalVersion=$env:FULLVERSION `
--self-contained
- name: Build ARM64
run: |
dotnet publish WindowsEdgeLight/WindowsEdgeLight.csproj `
-c Release `
-r win-arm64 `
/p:DebugType=None `
/p:DebugSymbols=false `
/p:Version=$env:VERSION `
/p:AssemblyVersion=$env:ASSEMBLY_VERSION `
/p:FileVersion=$env:ASSEMBLY_VERSION `
/p:AssemblyInformationalVersion=$env:FULLVERSION `
--self-contained
- name: Azure Login
uses: azure/login@v2
with:
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
- name: Sign executables with Trusted Signing
uses: azure/trusted-signing-action@v0
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://wus2.codesigning.azure.net/
trusted-signing-account-name: hanselman
certificate-profile-name: WindowsEdgeLight
files-folder: ${{ github.workspace }}\WindowsEdgeLight\bin\Release\net10.0-windows
files-folder-filter: exe
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Prepare artifacts
shell: pwsh
run: |
New-Item -ItemType Directory -Path artifacts -Force
# Use VERSION environment variable (calculated via GitVersion)
$version = $env:VERSION
# Create ZIP files with exe and README (so Updatum treats as portable app)
New-Item -ItemType Directory -Path "temp-x64" -Force
Copy-Item "WindowsEdgeLight/bin/Release/net10.0-windows/win-x64/publish/WindowsEdgeLight.exe" -Destination "temp-x64/"
Copy-Item "README.md" -Destination "temp-x64/"
Compress-Archive -Path "temp-x64/*" -DestinationPath "artifacts/WindowsEdgeLight-v$version-win-x64.zip"
New-Item -ItemType Directory -Path "temp-arm64" -Force
Copy-Item "WindowsEdgeLight/bin/Release/net10.0-windows/win-arm64/publish/WindowsEdgeLight.exe" -Destination "temp-arm64/"
Copy-Item "README.md" -Destination "temp-arm64/"
Compress-Archive -Path "temp-arm64/*" -DestinationPath "artifacts/WindowsEdgeLight-v$version-win-arm64.zip"
Remove-Item "temp-x64" -Recurse -Force
Remove-Item "temp-arm64" -Recurse -Force
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: WindowsEdgeLight-Release
path: artifacts/*.zip
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: artifacts/*.zip
body: |
## Windows Edge Light ${{ github.ref_name }}
A lightweight WPF application that adds a customizable glowing edge light effect around your primary monitor.
### 📦 Downloads
Choose the version for your Windows architecture:
- **WindowsEdgeLight-${{ github.ref_name }}-win-x64.zip** - For Intel/AMD 64-bit Windows
- **WindowsEdgeLight-${{ github.ref_name }}-win-arm64.zip** - For ARM64 Windows (Surface Pro X, etc.)
**What's inside:** Each ZIP contains `WindowsEdgeLight.exe` and `README.md` (self-contained, no .NET required)
### ✨ What's New
- **Automatic Updates**: Built-in update checker notifies you of new versions
- **One-Click Install**: Download and install updates directly from the app
- **Release Notes**: View what's new before updating
### 🚀 Features
- **Global Hotkeys**: Control from any application
- `Ctrl+Shift+L` - Toggle light on/off
- `Ctrl+Shift+↑` - Increase brightness
- `Ctrl+Shift+↓` - Decrease brightness
- **System Tray Icon**: Right-click for menu with all options
- **Primary Monitor Display**: Automatically detects and fits your main screen
- **DPI Aware**: Works perfectly on 4K displays
- **Click-Through**: Won't interfere with your work
Created by Scott Hanselman
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}