Repository navigation
168 lines (139 loc) · 5.89 KB
/
Copy pathbuild.yml
File metadata and controls
168 lines (139 loc) · 5.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
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@v7
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
- name: Cache NuGet packages
uses: actions/cache@v6
with:
path: ~\.nuget\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore WindowsEdgeLight.sln
- name: Test
run: dotnet test WindowsEdgeLight.sln --configuration Release --no-restore
- 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@v3
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@v1
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/
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@v7
with:
name: WindowsEdgeLight-Release
path: artifacts/*.zip
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v3
with:
files: artifacts/*.zip
generate_release_notes: true
body: |
## Windows Edge Light ${{ github.ref_name }}
### 📦 Downloads
| File | Platform |
|------|----------|
| `WindowsEdgeLight-${{ github.ref_name }}-win-x64.zip` | Intel/AMD 64-bit Windows |
| `WindowsEdgeLight-${{ github.ref_name }}-win-arm64.zip` | ARM64 Windows (Surface Pro X, etc.) |
**Self-contained** - Extract and run, no .NET installation required.
### ⌨️ Keyboard Shortcuts
- `Ctrl+Shift+L` - Toggle light on/off
- `Ctrl+Shift+↑` - Increase brightness
- `Ctrl+Shift+↓` - Decrease brightness
---
append_body: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}