Skip to content

Commit

Permalink
Merge pull request #24 from nblumhardt/net50-updates
Browse files Browse the repository at this point in the history
Modernization
  • Loading branch information
nblumhardt authored Aug 23, 2021
2 parents 887a593 + 7613996 commit b6d5f34
Show file tree
Hide file tree
Showing 232 changed files with 84 additions and 50,243 deletions.
66 changes: 17 additions & 49 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,9 @@ function Clean-Output
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
}

function Restore-Packages
{
& dotnet restore
}

function Update-WixVersion($version)
{
$defPattern = "define Version = ""0\.0\.0"""
$def = "define Version = ""$version"""
$product = ".\setup\Datalust.Piggy.Setup\Product.wxs"

(cat $product) | foreach {
% {$_ -replace $defPattern, $def }
} | sc -Encoding "UTF8" $product
}

function Execute-MSBuild($version)
{
& msbuild ./piggy.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 2 }
}

function Execute-Tests
{
& dotnet test ./test/Datalust.Piggy.Tests/Datalust.Piggy.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
& dotnet test ./test/Datalust.Piggy.Tests/Datalust.Piggy.Tests.csproj -c Release /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

Expand All @@ -38,38 +16,32 @@ function Create-ArtifactDir

function Publish-Gzips($version)
{
$rids = @("ubuntu.14.04-x64", "ubuntu.16.04-x64", "rhel.7-x64", "osx.10.12-x64")
$rids = @("linux-x64", "win-x64", "osx-x64")
foreach ($rid in $rids) {
& dotnet publish src/Datalust.Piggy/Datalust.Piggy.csproj -c Release -f netcoreapp2.0 -r $rid /p:VersionPrefix=$version
& dotnet publish src/Datalust.Piggy/Datalust.Piggy.csproj -c Release -f net5.0 -r $rid /p:VersionPrefix=$version /p:PublishSingleFile=true /p:SelfContained=true /p:PublishTrimmed=true
if($LASTEXITCODE -ne 0) { exit 4 }

# Make sure the archive contains a reasonable root filename
mv ./src/Datalust.Piggy/bin/Release/netcoreapp2.0/$rid/publish/ ./src/Datalust.Piggy/bin/Release/netcoreapp2.0/$rid/piggy-$version-$rid/
mv ./src/Datalust.Piggy/bin/Release/net5.0/$rid/publish/ ./src/Datalust.Piggy/bin/Release/net5.0/$rid/piggy-$version-$rid/

& ./build/7-zip/7za.exe a -ttar piggy-$version-$rid.tar ./src/Datalust.Piggy/bin/Release/netcoreapp2.0/$rid/piggy-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }
if ($rid -ne "win-x64") {
& ./build/7-zip/7za.exe a -ttar piggy-$version-$rid.tar ./src/Datalust.Piggy/bin/Release/net5.0/$rid/piggy-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

& ./build/7-zip/7za.exe a -tgzip ./artifacts/piggy-$version-$rid.tar.gz piggy-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

# Back to the original directory name
mv ./src/Datalust.Piggy/bin/Release/netcoreapp2.0/$rid/piggy-$version-$rid/ ./src/Datalust.Piggy/bin/Release/netcoreapp2.0/$rid/publish/
& ./build/7-zip/7za.exe a -tgzip ./artifacts/piggy-$version-$rid.tar.gz piggy-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }
rm piggy-$version-$rid.tar
} else {
& ./build/7-zip/7za.exe a -tzip ./artifacts/piggy-$version-$rid.zip ./src/Datalust.Piggy/bin/Release/net5.0/$rid/piggy-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 7 }
}

rm piggy-$version-$rid.tar
# Back to the original directory name
mv ./src/Datalust.Piggy/bin/Release/net5.0/$rid/piggy-$version-$rid/ ./src/Datalust.Piggy/bin/Release/net5.0/$rid/publish/
}
}

function Publish-Msi($version)
{
& dotnet publish src/Datalust.Piggy/Datalust.Piggy.csproj -c Release -f netcoreapp2.0 -r win10-x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 7 }

& msbuild ./setup/Datalust.Piggy.Setup/Datalust.Piggy.Setup.wixproj /t:Build /p:Configuration=Release /p:Platform=x64 /p:Version=$version /p:BuildProjectReferences=false
if($LASTEXITCODE -ne 0) { exit 8 }

mv ./setup/Datalust.Piggy.Setup/bin/Release/piggy.msi ./artifacts/piggy-$version.msi
}

function Publish-Nupkgs($version)
{
& dotnet pack src/Datalust.Piggy/Datalust.Piggy.csproj -c Release -o $PSScriptRoot/artifacts /p:VersionPrefix=$version /p:OutputType=Library
Expand All @@ -82,13 +54,9 @@ $version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:AP
Write-Output "Building version $version"

Clean-Output
Restore-Packages
Update-WixVersion($version)
Execute-MSBuild($version)
Execute-Tests
Create-ArtifactDir
Publish-Gzips($version)
Publish-Msi($version)
Publish-Nupkgs($version)

Pop-Location
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Piggy is a simple command-line tool for managing schema and data changes to Post

### Installation

Piggy is available for Windows, macOS and Linux from [the releases page](https://github.com/datalust/piggy/releases). Download the MSI or archive file for [your platform](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog). If your platform of choice isn't listed, please [raise an issue here](https://github.com/datalust/piggy/issues) so that we can add it.
Piggy is available for Windows, macOS and Linux from [the releases page](https://github.com/datalust/piggy/releases). If your platform of choice isn't listed, please [raise an issue here](https://github.com/datalust/piggy/issues) so that we can add it.

### Workflow

Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
version: 1.0.{build}
version: 2.0.{build}
skip_tags: true
image: Visual Studio 2019
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/piggy-*.msi
- path: artifacts/piggy-*.tar.gz
- path: artifacts/piggy-*.zip
- path: artifacts/Datalust.Piggy.*.nupkg
deploy:
- provider: NuGet
api_key:
secure: ErGkGoLMaZtkFgFcBIFjNn3twXKxEhO27F7vQGlx0m7ouCV3XdgGdSNERZOmdLLw
secure: qFvoUBcJYV2z0Q8x38cjFDdSdpPclcynF5/FcZbNmSDfQhqTy87D5vBZIp3HaO0I
skip_symbols: true
on:
branch: main
Expand Down
28 changes: 0 additions & 28 deletions build/wix/LICENSE.TXT

This file was deleted.

Binary file removed build/wix/LuxTasks.dll
Binary file not shown.
Binary file removed build/wix/ThmViewer.exe
Binary file not shown.
Binary file removed build/wix/WixBalExtension.dll
Binary file not shown.
Binary file removed build/wix/WixComPlusExtension.dll
Binary file not shown.
Binary file removed build/wix/WixCop.exe
Binary file not shown.
Binary file removed build/wix/WixDependencyExtension.dll
Binary file not shown.
Binary file removed build/wix/WixDifxAppExtension.dll
Binary file not shown.
Binary file removed build/wix/WixDirectXExtension.dll
Binary file not shown.
Binary file removed build/wix/WixFirewallExtension.dll
Binary file not shown.
Binary file removed build/wix/WixGamingExtension.dll
Binary file not shown.
Binary file removed build/wix/WixHttpExtension.dll
Binary file not shown.
Binary file removed build/wix/WixIIsExtension.dll
Binary file not shown.
Binary file removed build/wix/WixLuxExtension.dll
Binary file not shown.
Binary file removed build/wix/WixMsmqExtension.dll
Binary file not shown.
Binary file removed build/wix/WixNetFxExtension.dll
Binary file not shown.
Binary file removed build/wix/WixPSExtension.dll
Binary file not shown.
Binary file removed build/wix/WixSqlExtension.dll
Binary file not shown.
Binary file removed build/wix/WixTagExtension.dll
Binary file not shown.
Binary file removed build/wix/WixTasks.dll
Binary file not shown.
Binary file removed build/wix/WixToolset.BlockDeflateStream.dll
Binary file not shown.
Binary file removed build/wix/WixToolset.Data.dll
Binary file not shown.
Binary file removed build/wix/WixToolset.Dtf.Compression.Cab.dll
Binary file not shown.
Binary file removed build/wix/WixToolset.Dtf.Compression.dll
Binary file not shown.
Binary file removed build/wix/WixToolset.Dtf.Resources.dll
Binary file not shown.
Binary file not shown.
Binary file removed build/wix/WixToolset.Dtf.WindowsInstaller.dll
Binary file not shown.
Binary file removed build/wix/WixToolset.Extensibility.dll
Binary file not shown.
Binary file removed build/wix/WixUIExtension.dll
Binary file not shown.
Binary file removed build/wix/WixUtilExtension.dll
Binary file not shown.
Binary file removed build/wix/WixVSExtension.MSBuild12.dll
Binary file not shown.
Binary file removed build/wix/WixVSExtension.MSBuild14.dll
Binary file not shown.
Binary file removed build/wix/WixVSExtension.dll
Binary file not shown.
Binary file removed build/wix/candle.exe
Binary file not shown.
9 changes: 0 additions & 9 deletions build/wix/candle.exe.config

This file was deleted.

Binary file removed build/wix/darice.cub
Binary file not shown.
Binary file removed build/wix/dark.exe
Binary file not shown.
12 changes: 0 additions & 12 deletions build/wix/dark.exe.config

This file was deleted.

Binary file removed build/wix/difxapp_x64.wixlib
Binary file not shown.
Binary file removed build/wix/difxapp_x86.wixlib
Binary file not shown.
Binary file removed build/wix/doc/DTF.chm
Binary file not shown.
Binary file removed build/wix/doc/DTFAPI.chm
Binary file not shown.
Loading

0 comments on commit b6d5f34

Please sign in to comment.