Add workflow
All checks were successful
Test MS build / Test (push) Successful in 1m14s
Test MS build / Build (Release, x64) (push) Successful in 2m26s

This commit is contained in:
2023-11-19 20:37:01 +01:00
parent 2bca2aed97
commit 7293d61b11
4 changed files with 50 additions and 4 deletions

View File

@ -0,0 +1,45 @@
name: Test MS build
run-name: Test MS build
on: [push]
jobs:
test:
name: Test
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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 Elwig.sln; $a=$lastexitcode) | findstr x*; exit $a
- name: Build Elwig
shell: powershell
run: $(& msbuild -verbosity:quiet Elwig/Elwig.csproj -property:Configuration=Debug; $a=$lastexitcode) | findstr x*; exit $a
- name: Run Tests
shell: powershell
run: $(& dotnet test Tests; $a=$lastexitcode) | findstr x*; exit $a
build:
name: Build
needs: [test]
runs-on: windows-latest
strategy:
matrix:
configuration: [Release]
platform: [x64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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 Elwig.sln; $a=$lastexitcode) | findstr x*; exit $a
- name: Build Installer
shell: powershell
run: $(& msbuild -verbosity:quiet Installer/Installer.wixproj -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.platform }}; $a=$lastexitcode) | findstr x*; exit $a

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ bin/
*.user
.vs
.idea
PDFtoPrinter.exe

View File

@ -25,8 +25,8 @@
</Task>
</UsingTask>
<Target Name="CustomBeforeBuild" BeforeTargets="BeforeBuild">
<Exec Command="curl -s &quot;http://www.columbia.edu/~em36/PDFtoPrinter.exe&quot; -z &quot;$(TargetDir)PDFtoPrinter.exe&quot; -o &quot;$(TargetDir)PDFtoPrinter.exe&quot;" />
<Exec Command="dotnet publish &quot;$(SolutionDir)Elwig\Elwig.csproj&quot; &quot;/p:PublishProfile=$(SolutionDir)\Elwig\Properties\PublishProfiles\FolderProfile.pubxml&quot;" />
<Exec Command="curl -s &quot;http://www.columbia.edu/~em36/PDFtoPrinter.exe&quot; -z &quot;$(ProjectDir)\Files\PDFtoPrinter.exe&quot; -o &quot;$(ProjectDir)\Files\PDFtoPrinter.exe&quot;" />
<Exec Command="dotnet publish &quot;$(ProjectDir)\..\Elwig\Elwig.csproj&quot; &quot;/p:PublishProfile=$(ProjectDir)\..\Elwig\Properties\PublishProfiles\FolderProfile.pubxml&quot;" />
<GetFileVersion AssemblyPath="..\Elwig\bin\Publish\Elwig.exe">
<Output TaskParameter="Version" PropertyName="ElwigFileVersion" />
</GetFileVersion>
@ -62,4 +62,4 @@
<ItemGroup>
<PackageReference Include="WixToolset.Heat" Version="4.0.1" />
</ItemGroup>
</Project>
</Project>

View File

@ -11,7 +11,7 @@
<File Source="$(ProjectDir)\Files\WinziPrint.exe" Id="WinziPrint.exe"/>
</Component>
<Component Directory="InstallFolder">
<File Source="$(TargetDir)\PDFtoPrinter.exe" Id="PDFtoPrinter.exe"/>
<File Source="$(ProjectDir)\Files\PDFtoPrinter.exe" Id="PDFtoPrinter.exe"/>
</Component>
</ComponentGroup>
</Fragment>