mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06:00
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:
parent
e7d49fe48b
commit
e5ca44a0bd
2
.github/workflows/pre-release.yaml
vendored
2
.github/workflows/pre-release.yaml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
$version = ''
|
$version = ''
|
||||||
Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object {
|
Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object {
|
||||||
if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') {
|
if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') {
|
||||||
$version = $matches[1]
|
$version = "pre"+$matches[1]
|
||||||
echo "version=$version" >> $GITHUB_ENV
|
echo "version=$version" >> $GITHUB_ENV
|
||||||
echo "::set-output name=version::$version"
|
echo "::set-output name=version::$version"
|
||||||
break
|
break
|
||||||
|
1
.github/workflows/release.yaml
vendored
1
.github/workflows/release.yaml
vendored
@ -38,5 +38,6 @@ jobs:
|
|||||||
name: Release ${{ steps.extract_version.outputs.version }}
|
name: Release ${{ steps.extract_version.outputs.version }}
|
||||||
files: ./winutil.ps1
|
files: ./winutil.ps1
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
make_latest: "true"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
function Get-LatestRelease {
|
function Get-LatestRelease {
|
||||||
try {
|
try {
|
||||||
$releases = Invoke-RestMethod -Uri 'https://api.github.com/repos/ChrisTitusTech/winutil/releases'
|
$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
|
return $latestRelease.tag_name
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Error fetching release data: $_" -ForegroundColor Red
|
Write-Host "Error fetching release data: $_" -ForegroundColor Red
|
||||||
|
Loading…
Reference in New Issue
Block a user