Enhance Installer
Test / Run tests (push) Failing after 13s

This commit is contained in:
2026-08-05 16:31:32 +02:00
parent bf8533c857
commit 9c3cc8d4be
10 changed files with 134 additions and 45 deletions
+56
View File
@@ -0,0 +1,56 @@
name: Deploy
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
jobs:
deploy:
name: Build and Deploy
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Set APP_VERSION variable from tag
shell: powershell
run: |
$APP_VERSION = $env:GITHUB_REF -replace '^refs/tags/v', ''
Add-Content -Path $env:GITHUB_ENV -Value "APP_VERSION=$APP_VERSION"
- name: Checkout repository
uses: actions/checkout@v4
- name: Check version in project
shell: powershell
run: |
Select-String PamhagenSysCtrl/PamhagenSysCtrl.csproj -Pattern "<Version>"
$res = Select-String PamhagenSysCtrl/PamhagenSysCtrl.csproj -Pattern "<Version>${{ env.APP_VERSION }}</Version>"
if ($res -eq $null) {
exit 1
}
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
- name: Setup NuGet
uses: nuget/setup-nuget@v1
- name: Restore NuGet packages
shell: powershell
run: $(& nuget restore PamhagenSysCtrl.sln; $a=$lastexitcode) | findstr x*; exit $a
- name: Build Installer
shell: powershell
run: $(& msbuild -verbosity:quiet Installer/Installer.wixproj -property:Configuration=Release -property:Platform=x64; $a=$lastexitcode) | findstr x*; exit $a
- name: Rename artifact
shell: powershell
run: Move-Item Installer/bin/x64/Release/PamhagenSysCtrl.msi Installer/bin/x64/Release/PamhagenSysCtrl-${{ env.APP_VERSION }}.msi
- name: Create release
uses: akkuman/gitea-release-action@v1
with:
name: Anlagensteuerung Pamhagen ${{ env.APP_VERSION }}
body: "**[Changelog](src/branch/main/CHANGELOG.md#v${{ env.APP_VERSION }})**"
files: |-
Installer/bin/x64/Release/PamhagenSysCtrl-${{ env.APP_VERSION }}.msi
- name: Upload to website
shell: powershell
run: |
$content = [System.IO.File]::ReadAllBytes("Installer/bin/x64/Release/PamhagenSysCtrl-${{ env.APP_VERSION }}.msi")
Invoke-WebRequest `
-Uri "https://elwig.at/files/PamhagenSysCtrl-${{ env.APP_VERSION }}.msi" `
-Method PUT `
-Body $content `
-Headers @{ Authorization = "${{ secrets.API_AUTHORIZATION }}" } `
-ContentType "application/octet-stream"
+25
View File
@@ -0,0 +1,25 @@
name: Test
on:
push:
branches: ["**"]
paths: ["PamhagenSysCtrl/**", ".gitea/workflows/test.yaml"]
jobs:
test:
name: Run tests
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for Byte order marks
shell: powershell
run: |
$pattern = [char]::ConvertFromUtf32(0xFEFF)
$files = git grep -IEl "^$pattern"
if ( $lastexitcode -ne 1 ) {
echo "Files with BOM found:"
echo $files
exit 1
} else {
echo "No files with BOM found"
exit 0
}