From 1c72007a299df23ea3808a314bed3c3156ba4d22 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Wed, 17 Jul 2024 00:29:37 -0500 Subject: [PATCH] Update pre-release.yaml --- .github/workflows/pre-release.yaml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index a7c49fad..bb4c27bf 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -1,8 +1,12 @@ name: Pre-Release WinUtil +permissions: + contents: write + actions: read + on: workflow_run: - workflows: ["Compile"] #Ensure Compile winget.ps1 is done + workflows: ["Compile"] types: - completed workflow_dispatch: # Manual trigger added @@ -19,18 +23,8 @@ jobs: - name: Extract Version from winutil.ps1 id: extract_version run: | - $version = '' - Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object { - 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 - } + $version = "pre" + (Get-Date -Format "yyyy-MM-dd") + echo "version=$version" >> $env:GITHUB_ENV git tag $version git push origin $version shell: pwsh