[GitHub CI] Add cache for Netch

This commit is contained in:
Connection Refused
2021-10-16 15:50:39 +08:00
parent 30e76c8c52
commit efc95e04cf
3 changed files with 31 additions and 18 deletions

View File

@@ -14,10 +14,18 @@ jobs:
- name: Checksum
shell: pwsh
run: |
echo "SOURCE_NETCH_SHA256=$(.\sha256.ps1 .\Netch)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_OTHER_SHA256=$(.\sha256.ps1 .\Other)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_REDIRECTOR_SHA256=$(.\sha256.ps1 .\Redirector)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_ROUTEHELPER_SHA256=$(.\sha256.ps1 .\RouteHelper)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
- name: Cache Netch
uses: actions/cache@v2
with:
key: Netch-${{ runner.os }}-Netch-${{ env.SOURCE_NETCH_SHA256 }}
path: |
.\Netch\bin
- name: Cache Other
uses: actions/cache@v2
with:

View File

@@ -17,16 +17,17 @@ jobs:
- name: Checksum
shell: pwsh
run: |
echo "SOURCE_NETCH_SHA256=$(.\sha256.ps1 .\Netch)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_OTHER_SHA256=$(.\sha256.ps1 .\Other)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_REDIRECTOR_SHA256=$(.\sha256.ps1 .\Redirector)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_ROUTEHELPER_SHA256=$(.\sha256.ps1 .\RouteHelper)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
- name: Cache Other
- name: Cache Netch
uses: actions/cache@v2
with:
key: Netch-${{ runner.os }}-Other-${{ env.SOURCE_OTHER_SHA256 }}
key: Netch-${{ runner.os }}-Netch-${{ env.SOURCE_NETCH_SHA256 }}
path: |
.\Other\release
.\Netch\bin
- name: Cache Redirector
uses: actions/cache@v2

View File

@@ -15,7 +15,7 @@ param (
[Parameter()]
[bool]
$PublishReadyToRun = $False,
$PublishReadyToRun = $True,
[Parameter()]
[bool]
@@ -45,20 +45,24 @@ cp -Force '.\Other\release\*.bin' "$OutputPath\bin"
cp -Force '.\Other\release\*.dll' "$OutputPath\bin"
cp -Force '.\Other\release\*.exe' "$OutputPath\bin"
Write-Host
Write-Host 'Building Netch'
dotnet publish `
-c "$Configuration" `
-r 'win-x64' `
-p:Platform='x64' `
-p:SelfContained="$SelfContained" `
-p:PublishTrimmed="$SelfContained" `
-p:PublishReadyToRun="$PublishReadyToRun" `
-p:PublishSingleFile="$PublishSingleFile" `
-p:IncludeNativeLibrariesForSelfExtract="$SelfContained" `
-o "$OutputPath" `
'.\Netch\Netch.csproj'
if ( -Not $? ) { exit $lastExitCode }
if ( -Not ( Test-Path ".\Netch\bin\$Configuration" ) ) {
Write-Host
Write-Host 'Building Netch'
dotnet publish `
-c "$Configuration" `
-r 'win-x64' `
-p:Platform='x64' `
-p:SelfContained="$SelfContained" `
-p:PublishTrimmed="$SelfContained" `
-p:PublishReadyToRun="$PublishReadyToRun" `
-p:PublishSingleFile="$PublishSingleFile" `
-p:IncludeNativeLibrariesForSelfExtract="$SelfContained" `
-o ".\Netch\bin\$Configuration" `
'.\Netch\Netch.csproj'
if ( -Not $? ) { exit $lastExitCode }
}
cp -Force ".\Netch\bin\$Configuration\Netch.exe" "$OutputPath\bin"
if ( -Not ( Test-Path ".\Redirector\bin\$Configuration" ) ) {
Write-Host