diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index db91c743..0aa3950b 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -13,6 +13,7 @@ on: jobs: new-version: name: Bump version + if: "!contains(github.event.head_commit.message, '[no release]')" runs-on: windows-2019 outputs: previous_tag: ${{ steps.bump.outputs.previous_tag }} @@ -46,6 +47,7 @@ jobs: new-release: name: Create release + if: "!contains(github.event.head_commit.message, '[no release]')" runs-on: windows-2019 needs: new-version steps: diff --git a/build.ps1 b/build.ps1 index df08ce5c..4458851e 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,9 +4,15 @@ param( ) $baseDir = ".\Scripts\" +$outputDir = ".\Output" +$outputFile = "Release.zip" [array]$ignoredFiles = "0_Shared.ps1" -$releaseDirectory = New-Item -ItemType "Directory" -Path ".\" -Name "Output" +if(Test-Path -Path $outputDir) { + Remove-Item -Path $outputDir -Recurse +} + +$releaseDirectory = New-Item -ItemType "Directory" -Path ".\" -Name $outputDir $files = Get-ChildItem -Path $baseDir foreach($file in $files) { if($file.Name -in $ignoredFiles) { @@ -19,6 +25,11 @@ foreach($file in $files) { # inline include if($line -match "^\s*\.\s+([^#]+)#\s\[!build-include-inline\]") { $includeFile = $Matches[1] + + if($includeFile.Contains("`$PSScriptRoot")) { + $includeFile = $includeFile.Replace("`$PSScriptRoot", ".") + } + if($includeFile.StartsWith(".\")) { $includeFile = $includeFile.Substring(2) } @@ -39,4 +50,5 @@ foreach($file in $files) { $outFile = Join-Path -Path $releaseDirectory -ChildPath $file.Name Set-Content -Path $outFile -Value $output } -Compress-Archive -Path "$($releaseDirectory.FullName)\*" -DestinationPath Release.zip -CompressionLevel Optimal + +Compress-Archive -Path "$($releaseDirectory.FullName)\*" -DestinationPath $outputFile -CompressionLevel Optimal -Force