mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
Update build.yml
This commit is contained in:
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -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/') }}
|
||||
|
||||
18
build.ps1
18
build.ps1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user