ci(release): write outputs/env as utf8 no bom for powershell
This commit is contained in:
@@ -42,8 +42,9 @@ jobs:
|
|||||||
id: extract_version
|
id: extract_version
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$version = python -c "from app_version import APP_VERSION; print(APP_VERSION)"
|
$version = (python -c "from app_version import APP_VERSION; print(APP_VERSION)").Trim()
|
||||||
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||||
|
[System.IO.File]::AppendAllText($env:GITHUB_OUTPUT, "version=$version`n", $utf8NoBom)
|
||||||
Write-Host "Detected version: $version"
|
Write-Host "Detected version: $version"
|
||||||
|
|
||||||
- name: Stop if version already released
|
- name: Stop if version already released
|
||||||
@@ -54,12 +55,13 @@ jobs:
|
|||||||
git show-ref --tags --quiet --verify "refs/tags/$version"
|
git show-ref --tags --quiet --verify "refs/tags/$version"
|
||||||
$tagExists = ($LASTEXITCODE -eq 0)
|
$tagExists = ($LASTEXITCODE -eq 0)
|
||||||
$global:LASTEXITCODE = 0
|
$global:LASTEXITCODE = 0
|
||||||
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||||
if ($tagExists) {
|
if ($tagExists) {
|
||||||
Write-Host "Version $version already released, stopping job."
|
Write-Host "Version $version already released, stopping job."
|
||||||
"CONTINUE=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Version $version not released yet, continuing workflow..."
|
Write-Host "Version $version not released yet, continuing workflow..."
|
||||||
"CONTINUE=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=true`n", $utf8NoBom)
|
||||||
}
|
}
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user