Skip to content

Commit

Permalink
Improvements/Fixes for the Release Actions (ChrisTitusTech#2221)
Browse files Browse the repository at this point in the history
* add pre to tag to distinguish from full release

* explicitly serach for the newest pre-release

* set latest tag for releases
  • Loading branch information
Marterich authored Jun 29, 2024
1 parent e7d49fe commit e5ca44a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion windev.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5ca44a

Please sign in to comment.