Skip to content

Commit ea22dc9

Browse files
aaaaaaaaa
1 parent 04dfb4b commit ea22dc9

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ on:
88

99
permissions:
1010
contents: write
11-
11+
actions: write
12+
checks: write
1213
jobs:
1314
prepare:
1415
name: Prepare release (check files, version, notes)
15-
runs-on: windows-latest
16+
runs-on: ubuntu-latest
1617
outputs:
1718
should_release: ${{ steps.check_files.outputs.should_release }}
1819
version: ${{ steps.next_version.outputs.version }}
@@ -41,10 +42,10 @@ jobs:
4142
}
4243
4344
if ($sourceChanged) {
44-
"should_release=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
45+
Write-Output "should_release=true" >> $env:GITHUB_OUTPUT
4546
Write-Output "Source files changed - will proceed with release"
4647
} else {
47-
"should_release=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
48+
Write-Output "should_release=false" >> $env:GITHUB_OUTPUT
4849
Write-Output "No source files changed - skipping release"
4950
}
5051
@@ -73,10 +74,10 @@ jobs:
7374
}
7475
7576
if ($candidates.Count -gt 0) {
76-
$sorted = $candidates | Sort-Object -Property @{Expression={$_.Major};Descending=$true}, @{Expression={$_.Minor};Descending=$true}, @{Expression={$_.Patch};Descending=$true}
77-
$latestTag = $sorted[0].Tag
78-
"latest_tag=$latestTag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
79-
exit 0
77+
$sorted = $candidates | Sort-Object -Property @{Expression={$_.Major};Descending=$true}, @{Expression={$_.Minor};Descending=$true}, @{Expression={$_.Patch};Descending=$true}
78+
$latestTag = $sorted[0].Tag
79+
Write-Output "latest_tag=$latestTag" >> $env:GITHUB_OUTPUT
80+
exit 0
8081
}
8182
8283
# Fallback: ensure tags are fetched and inspect local tags
@@ -90,12 +91,12 @@ jobs:
9091
} | Sort-Object -Property @{Expression={$_.Major};Descending=$true}, @{Expression={$_.Minor};Descending=$true}, @{Expression={$_.Patch};Descending=$true}
9192
if ($sortedTags.Count -gt 0) {
9293
$latestTag = $sortedTags[0].Tag
93-
"latest_tag=$latestTag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
94+
Write-Output "latest_tag=$latestTag" >> $env:GITHUB_OUTPUT
9495
} else {
95-
"latest_tag=v0.0.0" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
96+
Write-Output "latest_tag=v0.0.0" >> $env:GITHUB_OUTPUT
9697
}
9798
} else {
98-
"latest_tag=v0.0.0" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
99+
Write-Output "latest_tag=v0.0.0" >> $env:GITHUB_OUTPUT
99100
}
100101
101102
- name: Determine next version
@@ -110,8 +111,8 @@ jobs:
110111
$patch = [int]$Matches[3]
111112
$patch = $patch + 1
112113
$newVersion = "v$major.$minor.$patch"
113-
"version=$newVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
114-
"version_number=$major.$minor.$patch" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
114+
Write-Output "version=$newVersion" >> $env:GITHUB_OUTPUT
115+
Write-Output "version_number=$major.$minor.$patch" >> $env:GITHUB_OUTPUT
115116
} else {
116117
Write-Error "Could not parse version from tag: $latestTag"
117118
exit 1
@@ -160,9 +161,9 @@ jobs:
160161
$releaseNotes += "`n---`n*Commit: $commitSha*"
161162
162163
$delimiter = "EOF_$(Get-Random)"
163-
"notes<<$delimiter" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
164-
$releaseNotes | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
165-
$delimiter | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
164+
Write-Output "notes<<$delimiter" >> $env:GITHUB_OUTPUT
165+
Write-Output $releaseNotes >> $env:GITHUB_OUTPUT
166+
Write-Output $delimiter >> $env:GITHUB_OUTPUT
166167
167168
build:
168169
name: Build matrix for multiple Windows architectures

0 commit comments

Comments
 (0)