Improvements/Fixes for the Release Actions (#2221)

* add pre to tag to distinguish from full release

* explicitly serach for the newest pre-release

* set latest tag for releases
This commit is contained in:
Martin Wiethan 2024-06-29 13:46:52 +02:00 committed by GitHub
parent e7d49fe48b
commit e5ca44a0bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View File

@ -22,7 +22,7 @@ jobs:
$version = ''
Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object {
if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') {
$version = $matches[1]
$version = "pre"+$matches[1]
echo "version=$version" >> $GITHUB_ENV
echo "::set-output name=version::$version"
break

View File

@ -38,5 +38,6 @@ jobs:
name: Release ${{ steps.extract_version.outputs.version }}
files: ./winutil.ps1
prerelease: false
make_latest: "true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -16,7 +16,7 @@
function Get-LatestRelease {
try {
$releases = Invoke-RestMethod -Uri 'https://api.github.com/repos/ChrisTitusTech/winutil/releases'
$latestRelease = $releases | Select-Object -First 1
$latestRelease = $releases | Where-Object {$_.prerelease -eq $true} | Select-Object -First 1
return $latestRelease.tag_name
} catch {
Write-Host "Error fetching release data: $_" -ForegroundColor Red