mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
[GitHub CI] Add cache for Netch
This commit is contained in:
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -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:
|
||||
|
||||
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -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
|
||||
|
||||
16
build.ps1
16
build.ps1
@@ -15,7 +15,7 @@ param (
|
||||
|
||||
[Parameter()]
|
||||
[bool]
|
||||
$PublishReadyToRun = $False,
|
||||
$PublishReadyToRun = $True,
|
||||
|
||||
[Parameter()]
|
||||
[bool]
|
||||
@@ -45,9 +45,11 @@ 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 `
|
||||
if ( -Not ( Test-Path ".\Netch\bin\$Configuration" ) ) {
|
||||
Write-Host
|
||||
Write-Host 'Building Netch'
|
||||
|
||||
dotnet publish `
|
||||
-c "$Configuration" `
|
||||
-r 'win-x64' `
|
||||
-p:Platform='x64' `
|
||||
@@ -56,9 +58,11 @@ dotnet publish `
|
||||
-p:PublishReadyToRun="$PublishReadyToRun" `
|
||||
-p:PublishSingleFile="$PublishSingleFile" `
|
||||
-p:IncludeNativeLibrariesForSelfExtract="$SelfContained" `
|
||||
-o "$OutputPath" `
|
||||
-o ".\Netch\bin\$Configuration" `
|
||||
'.\Netch\Netch.csproj'
|
||||
if ( -Not $? ) { exit $lastExitCode }
|
||||
if ( -Not $? ) { exit $lastExitCode }
|
||||
}
|
||||
cp -Force ".\Netch\bin\$Configuration\Netch.exe" "$OutputPath\bin"
|
||||
|
||||
if ( -Not ( Test-Path ".\Redirector\bin\$Configuration" ) ) {
|
||||
Write-Host
|
||||
|
||||
Reference in New Issue
Block a user