From e5ca44a0bd13e9c4e867a630a049a57325b4a7fe Mon Sep 17 00:00:00 2001 From: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Date: Sat, 29 Jun 2024 13:46:52 +0200 Subject: [PATCH] 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 --- .github/workflows/pre-release.yaml | 2 +- .github/workflows/release.yaml | 1 + windev.ps1 | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index 603739f5..0cc68253 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6728470a..6d59bb73 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 }} diff --git a/windev.ps1 b/windev.ps1 index 986bf52c..2efc3e77 100644 --- a/windev.ps1 +++ b/windev.ps1 @@ -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