Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Connection Refused committed Apr 1, 2021
1 parent 9f10542 commit 5fca9c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/') }}
Expand Down
18 changes: 9 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
param (
[Alias('c')]
[Parameter()]
[ValidateSet('Debug', 'Release')]
[string]
$Configuration = 'Release',

[Alias('o')]
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]
$OutputPath = 'Netch\bin\Publish\',
$OutputPath = 'release',

[Parameter()]
[bool]
$SelfContained = $False,

[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" `
Expand All @@ -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
6 changes: 4 additions & 2 deletions download.ps1
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5fca9c5

Please sign in to comment.