Skip to content

Commit

Permalink
check if tag already exists, before gh release create
Browse files Browse the repository at this point in the history
  • Loading branch information
jakoch committed Feb 5, 2025
1 parent ef30972 commit 762b472
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/build-mesa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,22 +301,26 @@ jobs:
retention-days: 3

# This is a date based version for repeatable releases (date.run.run_attempt).
- name: Set Rolling Release Version for Tag
- name: 🏷️ Set Rolling Release Version for Tag
shell: pwsh
run: |
echo "RELEASE_VERSION_TAG=$(Get-Date -Format 'yyyyMMdd').${{ github.run_number }}.${{ github.run_attempt }}" >> $env:GITHUB_ENV
Write-Output "RELEASE_VERSION_TAG: $Env:RELEASE_VERSION_TAG"
# Step 1: Create a new release tag, if not exists.
- name: 📦 🚀 Create Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
gh release create "${{ env.RELEASE_VERSION_TAG }}" `
--title "${{ env.MESA_LVP_ARTIFACT_NAME }}" `
--notes "Mesa Lavapipe for Windows (x64, VC17) ${{ env.MESA_LVP_VERSION }}" `
--latest
if (-not (gh release view "${{ env.RELEASE_VERSION_TAG }}" *> $null)) {
gh release create "${{ env.RELEASE_VERSION_TAG }}" `
--title "${{ env.MESA_LVP_ARTIFACT_NAME }}" `
--notes "Mesa Lavapipe for Windows (x64, VC17) ${{ env.MESA_LVP_VERSION }}" `
--latest
} else {
echo "✅ Release ${{ env.RELEASE_VERSION_TAG }} already exists. Skipping creation."
}
# Step 2: Upload the artifact to the release tag.
- name: 📦 🔼 Upload Release Artifact
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/build-swiftshader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,28 @@ jobs:
retention-days: 3

# This is a date based version for repeatable releases (date.run.run_attempt).
- name: Set Rolling Release Version for Tag
- name: 🏷️ Set Rolling Release Version for Tag
shell: pwsh
run: |
echo "RELEASE_VERSION_TAG=$(Get-Date -Format 'yyyyMMdd').${{ github.run_number }}.${{ github.run_attempt }}" >> $env:GITHUB_ENV
Write-Output "RELEASE_VERSION_TAG: $Env:RELEASE_VERSION_TAG"
# Step 1: Create a new release tag, if not exists.
- name: 📦 🚀 Create Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
gh release create "${{ env.RELEASE_VERSION_TAG }}" `
--title "${{ env.SWIFTSHADER_ARTIFACT_NAME }}" `
--notes "Swiftshader for Windows (x64, VC17) ${{ env.SWIFTSHADER_VERSION }}" `
--latest
if (-not (gh release view "${{ env.RELEASE_VERSION_TAG }}" *> $null)) {
gh release create "${{ env.RELEASE_VERSION_TAG }}" `
--title "${{ env.SWIFTSHADER_ARTIFACT_NAME }}" `
--notes "Swiftshader for Windows (x64, VC17) ${{ env.SWIFTSHADER_VERSION }}" `
--latest
} else {
echo "✅ Release ${{ env.RELEASE_VERSION_TAG }} already exists. Skipping creation."
}
# Step 2: Upload the artifact to the release tag.
- name: 📦 🔼 Upload Release Artifact
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
Expand Down

0 comments on commit 762b472

Please sign in to comment.