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:
fetch-depth: 1
- name: Download
shell: pwsh
run: .\download.ps1
- name: Build
shell: pwsh
run: .\build.ps1 Release -o release
run: |
.\build.ps1 -Configuration Release -OutputPath release
- name: Upload
if: ${{ !startsWith(github.ref, 'refs/tags/') }}

View File

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

View File

@@ -1,9 +1,11 @@
param([string]$OutputPath)
$NetchDataURL="https://github.com/NetchX/NetchData/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"
New-Item -ItemType Directory -Name release | Out-Null
Set-Location release
New-Item -ItemType Directory -Name $OutputPath | Out-Null
Set-Location $OutputPath
Invoke-WebRequest -Uri $NetchDataURL -OutFile data.zip
Invoke-WebRequest -Uri $NetchModeURL -OutFile mode.zip