mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
simplify prerelease deletion
This commit is contained in:
parent
5fb2ae839f
commit
22504e9e84
1 changed files with 2 additions and 24 deletions
26
.github/workflows/publish-beta.yml
vendored
26
.github/workflows/publish-beta.yml
vendored
|
|
@ -85,22 +85,10 @@ jobs:
|
|||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Get the version that was set in the previous step
|
||||
$versionWithBeta = (Get-Content package.json | ConvertFrom-Json).version
|
||||
Write-Host "Checking for existing releases with tag: $versionWithBeta"
|
||||
|
||||
# Delete release by tag if it exists
|
||||
$releaseExists = gh release view $versionWithBeta 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "Found existing release with tag $versionWithBeta, deleting it..."
|
||||
gh release delete $versionWithBeta --yes
|
||||
Write-Host "Successfully deleted existing release with tag $versionWithBeta"
|
||||
} else {
|
||||
Write-Host "No existing release found with tag $versionWithBeta"
|
||||
}
|
||||
|
||||
# Find and delete any releases with isPrerelease "true"
|
||||
Write-Host "Deleting existing prereleases..."
|
||||
Write-Host "Searching for releases with isPrerelease 'true'..."
|
||||
|
||||
$betaReleases = gh release list --limit 30 --json tagName,isPrerelease,name | ConvertFrom-Json | Where-Object { $_.isPrerelease -eq $true }
|
||||
|
||||
if ($betaReleases) {
|
||||
|
|
@ -114,16 +102,6 @@ jobs:
|
|||
Write-Host "No releases found with isPrerelease 'true'"
|
||||
}
|
||||
|
||||
# Delete the tag if it exists (in case release was deleted but tag remained)
|
||||
$tagExists = gh api repos/:owner/:repo/git/refs/tags/$versionWithBeta 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "Found existing tag $versionWithBeta, deleting it..."
|
||||
gh api -X DELETE repos/:owner/:repo/git/refs/tags/$versionWithBeta
|
||||
Write-Host "Successfully deleted tag $versionWithBeta"
|
||||
} else {
|
||||
Write-Host "No existing tag found: $versionWithBeta"
|
||||
}
|
||||
|
||||
- name: Build and Publish releases (Windows)
|
||||
if: matrix.os == 'windows-latest'
|
||||
env:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue