Skip to content

Commit

Permalink
create a new release tag, or update(append) release notes if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jakoch committed Feb 5, 2025
1 parent 762b472 commit fd3b6a3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/build-mesa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,20 +306,26 @@ jobs:
run: |
echo "RELEASE_VERSION_TAG=$(Get-Date -Format 'yyyyMMdd').${{ github.run_number }}.${{ github.run_attempt }}" >> $env:GITHUB_ENV
# Step 1: Create a new release tag, if not exists.
- name: 📦 🚀 Create Release
# Step 1: Create a new release tag, or update(append) release notes if it exists.
- name: 📦 🚀 Create or Update Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
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
$tag = "${{ env.RELEASE_VERSION_TAG }}"
$new_notes = "• Mesa Lavapipe for Windows (x64, VC17) ${{ env.MESA_LVP_VERSION }}"
if (gh release view $tag *> $null) {
echo "✅ Release $tag already exists. Appending new notes."
$existing_notes = gh release view $tag --json body --jq ".body"
$updated_notes = "$existing_notes`n`n$new_notes"
gh release edit $tag --notes "$updated_notes"
} else {
echo "✅ Release ${{ env.RELEASE_VERSION_TAG }} already exists. Skipping creation."
echo "🚀 Creating new release: $tag"
gh release create $tag `
--title "$tag" `
--notes "$new_notes" `
--latest
}
# Step 2: Upload the artifact to the release tag.
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/build-swiftshader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,26 @@ jobs:
run: |
echo "RELEASE_VERSION_TAG=$(Get-Date -Format 'yyyyMMdd').${{ github.run_number }}.${{ github.run_attempt }}" >> $env:GITHUB_ENV
# Step 1: Create a new release tag, if not exists.
- name: 📦 🚀 Create Release
# Step 1: Create a new release tag, or update(append) release notes if it exists.
- name: 📦 🚀 Create or Update Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
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
$tag = "${{ env.RELEASE_VERSION_TAG }}"
$new_notes = "• Swiftshader for Windows (x64, VC17) ${{ env.SWIFTSHADER_VERSION }}`n"
if (gh release view $tag *> $null) {
echo "✅ Release $tag already exists. Appending new notes."
$existing_notes = gh release view $tag --json body --jq ".body"
$updated_notes = "$existing_notes`n$new_notes"
gh release edit $tag --notes "$updated_notes"
} else {
echo "✅ Release ${{ env.RELEASE_VERSION_TAG }} already exists. Skipping creation."
echo "🚀 Creating new release: $tag"
gh release create $tag `
--title "$tag" `
--notes "$new_notes" `
--latest
}
# Step 2: Upload the artifact to the release tag.
Expand Down

0 comments on commit fd3b6a3

Please sign in to comment.