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