Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Windows Installer in Pipeline #9

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@ jobs:
gist_id: 527882e89a938dc78f61a08c300edec4
gist_description: "code-coverage-${{ github.ref_name }}"
gist_file_name: fmsync-code-coverage-${{ github.ref_name }}.svg
file_path: tests/TestResults/badge_shieldsio_linecoverage_green.svg
file_path: tests/TestResults/badge_shieldsio_linecoverage_green.svg
- name: Build Windows Installer
if: matrix.os == 'windows-latest'
run: ./Build/build-windows-installer.ps1
shell: pwsh
- name: Tag With SemVer
if: github.ref_name == 'main'
run: ./Build/tag-with-semver.ps1
shell: pwsh
12 changes: 8 additions & 4 deletions Build/build-and-test.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
dotnet test `
$ErrorActionPreference = "Stop"

$repoRootPath = (Resolve-Path "$PSScriptRoot/../").Path

dotnet test $repoRootPath/Elzik.FmSync.sln `
-c Release `
--verbosity normal `
-p:CollectCoverage=true `
Expand All @@ -10,6 +14,6 @@ dotnet tool update `
--version 5.1.8

reportgenerator `
"-reports:tests/Elzik.FmSync.Application.Tests.Unit/TestResults/coverage.opencover.xml;tests/Elzik.FmSync.Infrastructure.Tests.Integration/TestResults/coverage.opencover.xml;" `
"-targetdir:tests/TestResults" `
"-reporttypes:Badges"
"-reports:$repoRootPath/tests/Elzik.FmSync.Application.Tests.Unit/TestResults/coverage.opencover.xml;$repoRootPath/tests/Elzik.FmSync.Infrastructure.Tests.Integration/TestResults/coverage.opencover.xml;" `
"-targetdir:$repoRootPath/tests/TestResults" `
"-reporttypes:Badges"
10 changes: 7 additions & 3 deletions Build/build-windows-installer.ps1
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
dotnet publish $PSScriptRoot\..\src\Elzik.FmSync.Worker\Elzik.FmSync.Worker.csproj `
$ErrorActionPreference = "Stop"

$repoRootPath = (Resolve-Path "$PSScriptRoot/../").Path

dotnet publish $repoRootPath\src\Elzik.FmSync.Worker\Elzik.FmSync.Worker.csproj `
--runtime win-x64 `
--self-contained true `
--configuration Release `
-p:Platform=x64 `
-p:PublishSingleFile=true

dotnet publish $PSScriptRoot\..\src\Elzik.FmSync.Console\Elzik.FmSync.Console.csproj `
dotnet publish $repoRootPath\src\Elzik.FmSync.Console\Elzik.FmSync.Console.csproj `
--runtime win-x64 `
--self-contained true `
--configuration Release `
-p:Platform=x64 `
-p:PublishSingleFile=true

dotnet build $PSScriptRoot\..\Installer\Elzik.FmSync.WindowsInstaller\Elzik.FmSync.WindowsInstaller.wixproj `
dotnet build $repoRootPath\Installer\Elzik.FmSync.WindowsInstaller\Elzik.FmSync.WindowsInstaller.wixproj `
--runtime win-x64 `
--self-contained true `
--configuration Release `
Expand Down
4 changes: 2 additions & 2 deletions Build/local-pipeline.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ErrorActionPreference = "Stop"

& Build/build-and-test.ps1
& Build/build-windows-installer.ps1
& $PSScriptRoot/build-and-test.ps1
& $PSScriptRoot/build-windows-installer.ps1
6 changes: 6 additions & 0 deletions Build/tag-with-semver.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dotnet tool update --global GitVersion.Tool
$semVer = (dotnet-gitversion | ConvertFrom-Json).SemVer
$tag = "v$semVer"
git tag $tag -f
git push --tags
Write-Output "Tagged with $tag"