mirror of
https://github.com/netchx/netch.git
synced 2026-05-05 22:35:48 +08:00
Update BUILD.ps1
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -8,6 +8,8 @@ jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
OutputPath: Netch\bin\Publish\Debug
|
||||
steps:
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
@@ -19,7 +21,7 @@ jobs:
|
||||
|
||||
- name: Build Solution
|
||||
shell: pwsh
|
||||
run: .\BUILD.ps1
|
||||
run: .\BUILD.ps1 Debug -o ${{ env.OutputPath }}
|
||||
|
||||
- name: Upload Artifact
|
||||
continue-on-error: true
|
||||
@@ -27,4 +29,4 @@ jobs:
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Netch
|
||||
path: Netch\bin\x64\Release
|
||||
path: ${{ env.OutputPath }}
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
|
||||
- name: Build Solution
|
||||
shell: pwsh
|
||||
run: .\PUBLISH.ps1
|
||||
run: .\BUILD.ps1
|
||||
|
||||
- name: Package
|
||||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
|
||||
|
||||
36
BUILD.ps1
36
BUILD.ps1
@@ -1,8 +1,38 @@
|
||||
Write-Host 'Building'
|
||||
param (
|
||||
[Alias('c')]
|
||||
[Parameter()]
|
||||
[ValidateSet('Debug', 'Release')]
|
||||
[string]
|
||||
$Configuration = 'Release',
|
||||
|
||||
dotnet build `
|
||||
-c "Release" `
|
||||
[Alias('o')]
|
||||
[Parameter()]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]
|
||||
$OutputPath = 'Netch\bin\Publish\',
|
||||
|
||||
[Parameter()]
|
||||
[bool]
|
||||
$SelfContained = $False,
|
||||
|
||||
[Parameter()]
|
||||
[bool]
|
||||
$PublishReadyToRun = $False
|
||||
)
|
||||
|
||||
$PublishSingleFile = $True
|
||||
|
||||
Write-Host "Building $Configuration to $OutputPath"
|
||||
|
||||
dotnet publish `
|
||||
-c $Configuration `
|
||||
-r "win-x64" `
|
||||
-p:Platform="x64" `
|
||||
-p:PublishSingleFile=$PublishSingleFile `
|
||||
-p:SelfContained=$SelfContained `
|
||||
-p:PublishTrimmed=$SelfContained `
|
||||
-p:PublishReadyToRun=$PublishReadyToRun `
|
||||
-o $OutputPath `
|
||||
Netch\Netch.csproj
|
||||
|
||||
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
||||
|
||||
16
PUBLISH.ps1
16
PUBLISH.ps1
@@ -1,16 +0,0 @@
|
||||
Write-Host 'Building'
|
||||
|
||||
dotnet publish `
|
||||
-c "Release" `
|
||||
-r "win-x64" `
|
||||
-p:Platform="x64" `
|
||||
-p:PublishSingleFile=true `
|
||||
-p:SelfContained=false `
|
||||
-p:PublishTrimmed=false `
|
||||
-p:PublishReadyToRun=false `
|
||||
-o Netch\bin\Publish\ `
|
||||
Netch\Netch.csproj
|
||||
|
||||
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
||||
|
||||
Write-Host 'Build done'
|
||||
Reference in New Issue
Block a user