Repository navigation
59 lines (48 loc) · 1.68 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (48 loc) · 1.68 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
name: Build & Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup .NET 8 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore Dependencies
run: dotnet restore LockGate.sln
- name: Run Tests
run: dotnet run --project tests/LockGate.Core.Tests -c Release
- name: Install Inno Setup
run: choco install innosetup --no-progress
- name: Package Release & Compile Installer
shell: pwsh
run: |
$version = "${{ github.ref_name }}".TrimStart('v')
if (-not $version -or $version -eq "${{ github.ref }}") { $version = "1.0.0" }
.\scripts\package.ps1 -Version $version
- name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/')
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$tag = "${{ github.ref_name }}"
$assets = (Get-ChildItem -Path release -File).FullName
Write-Host "Found assets to upload:"
$assets | ForEach-Object { Write-Host " - $_" }
$exists = gh release view $tag 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Host "Release $tag already exists, uploading/overwriting assets..."
gh release upload $tag @assets --clobber
} else {
Write-Host "Creating release $tag..."
gh release create $tag @assets --title "LockGate $tag - Windows Native App Locker" --generate-notes
}