From 454b03a69fa6048bef5c5163ab304d2bea073fb0 Mon Sep 17 00:00:00 2001 From: Bruce Wayne Date: Sat, 10 Oct 2020 22:22:41 +0800 Subject: [PATCH] Fix build scripts --- .github/workflows/build.yml | 8 ++++---- BUILD.ps1 | 38 +++++++++---------------------------- 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fec1a407..8cf6195b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,16 +18,16 @@ jobs: run: | .\BUILD.ps1 New-Item -ItemType Directory -Path C:\builtfiles -Force > $null - 7z a -mx9 C:\builtfiles\Netch.7z .\Netch\bin\x64\Release\win-x64\ - 7z rn C:\builtfiles\Netch.7z win-x64 Netch + 7z a -mx9 C:\builtfiles\Netch.7z .\Netch\bin\x64\Release\ + 7z rn C:\builtfiles\Netch.7z Release Netch echo "Netch_SHA256=$(.\GetSHA256.ps1 C:\builtfiles\Netch.7z)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "Netch_EXE_SHA256=$(.\GetSHA256.ps1 Netch\bin\x64\Release\win-x64\Netch.exe)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "Netch_EXE_SHA256=$(.\GetSHA256.ps1 Netch\bin\x64\Release\Netch.exe)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Upload Artifact uses: actions/upload-artifact@v2 with: name: Netch - path: Netch\bin\x64\Release\win-x64 + path: Netch\bin\x64\Release - name: Release uses: softprops/action-gh-release@v1 diff --git a/BUILD.ps1 b/BUILD.ps1 index 5ee7ecb3..414265a7 100644 --- a/BUILD.ps1 +++ b/BUILD.ps1 @@ -1,32 +1,12 @@ -param([string]$buildtfm = 'all') +Write-Host 'Building' -Write-Host 'DotNet SDK Version' -dotnet --version +msbuild -v:n -m:1 /p:Configuration="Release" ` + /p:Platform="x64" ` + /p:TargetFramework=net48 ` + /p:SolutionDir="..\" ` + /restore ` + Netch\Netch.csproj -$mainDir = (Get-Item -Path ".\").FullName -$net_baseoutput = "$mainDir\Netch\bin\$configuration" +if ($LASTEXITCODE) { exit $LASTEXITCODE } -Write-Host $mainDir -Write-Host $net_baseoutput - -function Build-NetFrameworkx64 -{ - Write-Host 'Building .NET Framework x64' - - $outdir = "$net_baseoutput\x64" - - msbuild -v:n -m:1 /p:Configuration="Release" ` - /p:Platform="x64" ` - /p:TargetFramework=net48 ` - /p:Runtimeidentifier=win-x64 ` - /restore - if ($LASTEXITCODE) { cd $mainDir ; exit $LASTEXITCODE } - - Write-Host 'Build done' -} - -cd $mainDir -Build-NetFrameworkx64 -cd $mainDir - -exit 0 +Write-Host 'Build done'