Compare commits
2
Commits
47455d9291
...
9c3cc8d4be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c3cc8d4be | ||
|
|
bf8533c857 |
No files matched your search
@@ -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"
|
||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -4,3 +4,4 @@ bin/
|
|||||||
.vs
|
.vs
|
||||||
.idea
|
.idea
|
||||||
*.exe
|
*.exe
|
||||||
|
*.zip
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
Pamhagen
|
||||||
|
========
|
||||||
|
|
||||||
|
Source code
|
||||||
|
C:\Program Files\Anlagensteuerung Pamhagen\src\pamhagen-sysctrl.zip
|
||||||
|
https://git.necronda.net/winzer/pamhagen-sysctrl
|
||||||
|
|
||||||
|
Installation folder
|
||||||
|
C:\Program Files\Anlagensteuerung Pamhagen\
|
||||||
|
|
||||||
|
Data and configuration folder
|
||||||
|
C:\ProgramData\Anlagensteuerung Pamhagen\
|
||||||
|
- config.ini : main configuration file
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
[plc]
|
||||||
|
port = COM1
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||||
|
<Fragment>
|
||||||
|
<!-- C:\Program Files (x86)\Anlagensteuerung Pamhagen or C:\Program Files\Anlagensteuerung Pamhagen -->
|
||||||
|
<StandardDirectory Id="ProgramFiles64Folder">
|
||||||
|
<Directory Id="InstallFolder" Name="!(bind.Property.ProductName)">
|
||||||
|
<Directory Id="SourceFolder" Name="src" />
|
||||||
|
</Directory>
|
||||||
|
</StandardDirectory>
|
||||||
|
|
||||||
|
<!-- C:\ProgramData\Anlagensteuerung Pamhagen -->
|
||||||
|
<StandardDirectory Id="CommonAppDataFolder">
|
||||||
|
<Directory Id="ConfigFolder" Name="!(bind.Property.ProductName)" />
|
||||||
|
</StandardDirectory>
|
||||||
|
|
||||||
|
<!-- C:\ProgramData\Microsoft\Windows\Start Menu\Programs -->
|
||||||
|
<StandardDirectory Id="ProgramMenuFolder">
|
||||||
|
<Directory Id="StartMenuProgramsFolder" Name="!(bind.Property.ProductName)" />
|
||||||
|
</StandardDirectory>
|
||||||
|
|
||||||
|
<!-- C:\Users\{USERNAME}\Desktop -->
|
||||||
|
<StandardDirectory Id="DesktopFolder" />
|
||||||
|
</Fragment>
|
||||||
|
</Wix>
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<Project Sdk="WixToolset.Sdk/7.0.0">
|
||||||
|
<PropertyGroup>
|
||||||
|
<InstallerPlatform>x64</InstallerPlatform>
|
||||||
|
<OutputName>PamhagenSysCtrl</OutputName>
|
||||||
|
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||||
|
<Cultures>de-AT</Cultures>
|
||||||
|
<AcceptEula>wix7</AcceptEula>
|
||||||
|
<SuppressValidation>false</SuppressValidation>
|
||||||
|
<PublishDirectory>$(MSBuildProjectDirectory)\..\PamhagenSysCtrl\bin\Publish</PublishDirectory>
|
||||||
|
</PropertyGroup>
|
||||||
|
<UsingTask TaskName="GetFileVersion" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
|
||||||
|
<ParameterGroup>
|
||||||
|
<AssemblyPath ParameterType="System.String" Required="true" />
|
||||||
|
<Version ParameterType="System.String" Output="true" />
|
||||||
|
</ParameterGroup>
|
||||||
|
<Task>
|
||||||
|
<Using Namespace="System.Diagnostics" />
|
||||||
|
<Code Type="Fragment" Language="cs"><![CDATA[
|
||||||
|
Version = FileVersionInfo.GetVersionInfo(AssemblyPath).ProductVersion.Split('+')[0];
|
||||||
|
]]></Code>
|
||||||
|
</Task>
|
||||||
|
</UsingTask>
|
||||||
|
<Target Name="PublishApplication" BeforeTargets="BeforeBuild">
|
||||||
|
<RemoveDir Directories="$(PublishDirectory)" Condition="Exists('$(PublishDirectory)')" />
|
||||||
|
<Exec Command="dotnet publish "$(MSBuildProjectDirectory)\..\PamhagenSysCtrl\PamhagenSysCtrl.csproj" --configuration "$(Configuration)" --runtime win-x64 --self-contained true --output "$(PublishDirectory)" --nologo" />
|
||||||
|
<GetFileVersion AssemblyPath="$(PublishDirectory)\PamhagenSysCtrl.exe">
|
||||||
|
<Output TaskParameter="Version" PropertyName="ProductVersion" />
|
||||||
|
</GetFileVersion>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DefineConstants>ProductVersion=$(ProductVersion);BuildPath=$(PublishDirectory)</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
<Target Name="CreateSourceArchive" BeforeTargets="BeforeBuild">
|
||||||
|
<Exec Command="git -C "$(MSBuildProjectDirectory)\.." archive --format=zip --output "$(MSBuildProjectDirectory)\Files\pamhagen-sysctrl.zip" HEAD" />
|
||||||
|
</Target>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\PamhagenSysCtrl\PamhagenSysCtrl.csproj" ReferenceOutputAssembly="false" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Files\config.ini" />
|
||||||
|
<None Include="Files\README.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||||
|
<Fragment>
|
||||||
|
<ComponentGroup Id="MainComponents">
|
||||||
|
<Component Directory="InstallFolder">
|
||||||
|
<File Source="$(var.BuildPath)\PamhagenSysCtrl.exe" Id="PamhagenSysCtrl.exe"/>
|
||||||
|
</Component>
|
||||||
|
<Files Directory="InstallFolder" Include="$(var.BuildPath)\**">
|
||||||
|
<Exclude Files="$(var.BuildPath)\PamhagenSysCtrl.exe"/>
|
||||||
|
<Exclude Files="$(var.BuildPath)\**.pdb"/>
|
||||||
|
</Files>
|
||||||
|
<Component Directory="SourceFolder">
|
||||||
|
<File Source="$(ProjectDir)\Files\pamhagen-sysctrl.zip" Id="pamhagen_sysctrl.zip"/>
|
||||||
|
</Component>
|
||||||
|
<Component Directory="ConfigFolder" Permanent="true" NeverOverwrite="true">
|
||||||
|
<File Source="$(ProjectDir)\Files\config.ini" Id="config.ini"/>
|
||||||
|
</Component>
|
||||||
|
<Component Directory="ConfigFolder">
|
||||||
|
<File Source="$(ProjectDir)\Files\README.txt" Id="README.txt"/>
|
||||||
|
</Component>
|
||||||
|
</ComponentGroup>
|
||||||
|
</Fragment>
|
||||||
|
</Wix>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl"
|
||||||
|
Culture="de-AT">
|
||||||
|
<String Id="DowngradeError"
|
||||||
|
Value="Eine neuere Version von [ProductName] ist bereits installiert." />
|
||||||
|
</WixLocalization>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||||
|
<Package Name="Anlagensteuerung Pamhagen"
|
||||||
|
Manufacturer="Anlagensteuerung Pamhagen"
|
||||||
|
Version="$(var.ProductVersion)"
|
||||||
|
Language="3079"
|
||||||
|
UpgradeCode="f214bfc6-1cd0-4971-807e-a4830e3b82a3"
|
||||||
|
Scope="perMachine"
|
||||||
|
Compressed="true">
|
||||||
|
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="no"/>
|
||||||
|
<MediaTemplate EmbedCab="true" CompressionLevel="high"/>
|
||||||
|
|
||||||
|
<Feature Id="Main" Title="Anlagensteuerung Pamhagen" Level="1">
|
||||||
|
<ComponentGroupRef Id="MainComponents"/>
|
||||||
|
<ComponentGroupRef Id="ShortcutComponents"/>
|
||||||
|
</Feature>
|
||||||
|
</Package>
|
||||||
|
</Wix>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||||
|
<Fragment>
|
||||||
|
<ComponentGroup Id="ShortcutComponents">
|
||||||
|
<Component Id="StartMenuFolderShortcut"
|
||||||
|
Directory="StartMenuProgramsFolder"
|
||||||
|
Guid="6101b33f-9bc8-4d44-aad0-0f3eddc840c6">
|
||||||
|
<Shortcut Id="ApplicationStartMenuShortcut"
|
||||||
|
Name="!(bind.Property.ProductName)"
|
||||||
|
Description="!(bind.Property.ProductName)"
|
||||||
|
Target="[InstallFolder]PamhagenSysCtrl.exe"
|
||||||
|
WorkingDirectory="InstallFolder" />
|
||||||
|
<RemoveFolder Id="StartMenuProgramsFolder" On="uninstall" />
|
||||||
|
<RegistryValue Root="HKCU"
|
||||||
|
Key="Software\!(bind.Property.Manufacturer)\!(bind.Property.ProductName)"
|
||||||
|
Name="start_menu_installed"
|
||||||
|
Type="integer"
|
||||||
|
Value="1"
|
||||||
|
KeyPath="yes" />
|
||||||
|
</Component>
|
||||||
|
|
||||||
|
<Component Id="DesktopFolderShortcut"
|
||||||
|
Directory="DesktopFolder"
|
||||||
|
Guid="58b61147-4e5c-4581-8593-fc7bcb591048">
|
||||||
|
<Shortcut Id="DesktopShortcut"
|
||||||
|
Name="!(bind.Property.ProductName)"
|
||||||
|
Description="!(bind.Property.ProductName)"
|
||||||
|
Target="[InstallFolder]PamhagenSysCtrl.exe"
|
||||||
|
WorkingDirectory="InstallFolder" />
|
||||||
|
<RegistryValue Root="HKCU"
|
||||||
|
Key="Software\!(bind.Property.Manufacturer)\!(bind.Property.ProductName)"
|
||||||
|
Name="desktop_installed"
|
||||||
|
Type="integer"
|
||||||
|
Value="1"
|
||||||
|
KeyPath="yes" />
|
||||||
|
</Component>
|
||||||
|
</ComponentGroup>
|
||||||
|
</Fragment>
|
||||||
|
</Wix>
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
<Solution>
|
<Solution>
|
||||||
|
<Configurations>
|
||||||
|
<Platform Name="Any CPU" />
|
||||||
|
</Configurations>
|
||||||
|
<Project Path="Installer/Installer.wixproj">
|
||||||
|
<Platform Solution="*|Any CPU" Project="x64" />
|
||||||
|
<Build Solution="*|Any CPU" Project="true" />
|
||||||
|
</Project>
|
||||||
<Project Path="PamhagenSysCtrl/PamhagenSysCtrl.csproj" />
|
<Project Path="PamhagenSysCtrl/PamhagenSysCtrl.csproj" />
|
||||||
</Solution>
|
</Solution>
|
||||||
@@ -3,6 +3,9 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net10.0-windows</TargetFramework>
|
<TargetFramework>net10.0-windows</TargetFramework>
|
||||||
|
<Version>0.0.1</Version>
|
||||||
|
<Product>Anlagensteuerung Pamhagen</Product>
|
||||||
|
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
|
|||||||
Reference in new issue
Block a user