Update pre-release.yaml

This commit is contained in:
Chris Titus 2024-07-17 00:29:37 -05:00
parent 07434f706b
commit 1c72007a29

View File

@ -1,8 +1,12 @@
name: Pre-Release WinUtil name: Pre-Release WinUtil
permissions:
contents: write
actions: read
on: on:
workflow_run: workflow_run:
workflows: ["Compile"] #Ensure Compile winget.ps1 is done workflows: ["Compile"]
types: types:
- completed - completed
workflow_dispatch: # Manual trigger added workflow_dispatch: # Manual trigger added
@ -19,18 +23,8 @@ jobs:
- name: Extract Version from winutil.ps1 - name: Extract Version from winutil.ps1
id: extract_version id: extract_version
run: | run: |
$version = '' $version = "pre" + (Get-Date -Format "yyyy-MM-dd")
Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object { echo "version=$version" >> $env:GITHUB_ENV
if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') {
$version = "pre"+$matches[1]
echo "version=$version" >> $GITHUB_OUTPUT
break
}
}
if (-not $version) {
Write-Error "Version not found in winutil.ps1"
exit 1
}
git tag $version git tag $version
git push origin $version git push origin $version
shell: pwsh shell: pwsh