Update build.yml

This commit is contained in:
Connection Refused
2021-04-02 01:59:23 +08:00
parent 9f105425ab
commit 5fca9c55fe
3 changed files with 15 additions and 16 deletions

View File

@@ -14,13 +14,10 @@ jobs:
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Download
shell: pwsh
run: .\download.ps1
- name: Build - name: Build
shell: pwsh shell: pwsh
run: .\build.ps1 Release -o release run: |
.\build.ps1 -Configuration Release -OutputPath release
- name: Upload - name: Upload
if: ${{ !startsWith(github.ref, 'refs/tags/') }} if: ${{ !startsWith(github.ref, 'refs/tags/') }}

View File

@@ -1,15 +1,13 @@
param ( param (
[Alias('c')]
[Parameter()] [Parameter()]
[ValidateSet('Debug', 'Release')] [ValidateSet('Debug', 'Release')]
[string] [string]
$Configuration = 'Release', $Configuration = 'Release',
[Alias('o')]
[Parameter()] [Parameter()]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string] [string]
$OutputPath = 'Netch\bin\Publish\', $OutputPath = 'release',
[Parameter()] [Parameter()]
[bool] [bool]
@@ -17,13 +15,16 @@ param (
[Parameter()] [Parameter()]
[bool] [bool]
$PublishReadyToRun = $False $PublishReadyToRun = $False,
[Parameter()]
[bool]
$PublishSingleFile = $True,
) )
$PublishSingleFile = $True .\download.ps1 $OutputPath
Write-Host "Building $Configuration to $OutputPath" Write-Host "Building $Configuration to $OutputPath"
dotnet publish ` dotnet publish `
-c $Configuration ` -c $Configuration `
-r "win-x64" ` -r "win-x64" `
@@ -35,6 +36,5 @@ dotnet publish `
-o $OutputPath ` -o $OutputPath `
Netch\Netch.csproj Netch\Netch.csproj
if ($LASTEXITCODE) { exit $LASTEXITCODE } if ($lastExitCode) { exit $lastExitCode }
exit 0
Write-Host 'Build done'

View File

@@ -1,9 +1,11 @@
param([string]$OutputPath)
$NetchDataURL="https://github.com/NetchX/NetchData/archive/refs/heads/master.zip" $NetchDataURL="https://github.com/NetchX/NetchData/archive/refs/heads/master.zip"
$NetchModeURL="https://github.com/NetchX/NetchMode/archive/refs/heads/master.zip" $NetchModeURL="https://github.com/NetchX/NetchMode/archive/refs/heads/master.zip"
$NetchI18NURL="https://github.com/NetchX/NetchTranslation/archive/refs/heads/master.zip" $NetchI18NURL="https://github.com/NetchX/NetchTranslation/archive/refs/heads/master.zip"
New-Item -ItemType Directory -Name release | Out-Null New-Item -ItemType Directory -Name $OutputPath | Out-Null
Set-Location release Set-Location $OutputPath
Invoke-WebRequest -Uri $NetchDataURL -OutFile data.zip Invoke-WebRequest -Uri $NetchDataURL -OutFile data.zip
Invoke-WebRequest -Uri $NetchModeURL -OutFile mode.zip Invoke-WebRequest -Uri $NetchModeURL -OutFile mode.zip