mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +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:
|
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/') }}
|
||||||
|
|||||||
18
build.ps1
18
build.ps1
@@ -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'
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user