[Actions] Add option to skip a release (#377)

* Add option to skip a release
* updates to build script
This commit is contained in:
Vladimír 2020-07-28 16:50:26 +02:00 коммит произвёл GitHub
Родитель d447c2ff45
Коммит 379792d10b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 16 добавлений и 2 удалений

2
.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:

Просмотреть файл

@ -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