Skip to content

Commit 0b0a492

Browse files
handle dupe tag issue
1 parent 59674ed commit 0b0a492

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.github/workflows/create-bleeding-edge-release.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,26 @@ jobs:
8888
# Use the first artifact name for release naming (typically the main build)
8989
$mainArtifact = $buildArtifacts[0]
9090
91+
# For manual triggers, add timestamp to make tag unique
92+
$baseArtifactName = $mainArtifact.name
93+
if ("${{ github.event_name }}" -ne "schedule") {
94+
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
95+
$uniqueArtifactName = "${baseArtifactName}-${timestamp}"
96+
Write-Output "Manual trigger - using unique tag: $uniqueArtifactName"
97+
} else {
98+
$uniqueArtifactName = $baseArtifactName
99+
Write-Output "Scheduled run - using standard tag: $uniqueArtifactName"
100+
}
101+
91102
# Convert artifact IDs to JSON array for passing to next step
92103
$artifactIds = $buildArtifacts | ForEach-Object { $_.id }
93104
$artifactIdsJson = $artifactIds | ConvertTo-Json -Compress
94105
95106
echo "has_new_build=true" >> $env:GITHUB_OUTPUT
96107
echo "run_id=$runId" >> $env:GITHUB_OUTPUT
97108
echo "head_sha=$headSha" >> $env:GITHUB_OUTPUT
98-
echo "artifact_name=$($mainArtifact.name)" >> $env:GITHUB_OUTPUT
109+
echo "artifact_name=$uniqueArtifactName" >> $env:GITHUB_OUTPUT
110+
echo "base_artifact_name=$baseArtifactName" >> $env:GITHUB_OUTPUT
99111
echo "artifact_ids=$artifactIdsJson" >> $env:GITHUB_OUTPUT
100112
101113
- name: Download OptiScaler build artifacts
@@ -240,7 +252,7 @@ jobs:
240252
if: steps.check_builds.outputs.has_new_build == 'true'
241253
shell: powershell
242254
run: |
243-
$artifactName = "${{ steps.check_builds.outputs.artifact_name }}"
255+
$artifactName = "${{ steps.check_builds.outputs.base_artifact_name }}"
244256
$packageName = "${artifactName}-BleedingEdge"
245257
$packagePath = "${{ github.workspace }}\${packageName}.zip"
246258
@@ -279,7 +291,7 @@ jobs:
279291
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
280292
with:
281293
tag_name: ${{ steps.check_builds.outputs.artifact_name }}
282-
release_name: ${{ steps.check_builds.outputs.artifact_name }} - Bleeding Edge
294+
release_name: ${{ steps.check_builds.outputs.base_artifact_name }} - Bleeding Edge
283295
body: |
284296
🚀 **Automated Bleeding Edge Release**
285297
@@ -308,7 +320,9 @@ jobs:
308320
309321
**Build Information:**
310322
- OptiScaler Commit: `${{ steps.check_builds.outputs.head_sha }}`
311-
- Build Date: ${{ github.run_id }}
323+
- Base Artifact: `${{ steps.check_builds.outputs.base_artifact_name }}`
324+
- Release Tag: `${{ steps.check_builds.outputs.artifact_name }}`
325+
- Trigger: `${{ github.event_name }}`
312326
- Workflow Run: [View Details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
313327
draft: false
314328
prerelease: true
@@ -336,7 +350,7 @@ jobs:
336350
}
337351
338352
$body = @{
339-
description = "🚀 Automated bleeding-edge releases for OptiScaler | Latest: ${{ steps.check_builds.outputs.artifact_name }}"
353+
description = "🚀 Automated bleeding-edge releases for OptiScaler | Latest: ${{ steps.check_builds.outputs.base_artifact_name }}"
340354
} | ConvertTo-Json
341355
342356
try {

0 commit comments

Comments
 (0)