|
|
@@ -191,10 +191,14 @@ jobs:
|
|
|
env:
|
|
|
GITHUB_TOKEN: ${{ secrets.FLIPPER_TOKEN }}
|
|
|
run: |
|
|
|
- $url = (gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.REPOSITORY }}/releases/tags/v${{ env.RELEASE_VERSION }} >$null 2>&1) | ConvertFrom-Json -AsHashtable -ErrorAction SilentlyContinue
|
|
|
- if ( [string]::IsNullOrWhitespace($url.name) ) {
|
|
|
+ $mime = "Accept: application/vnd.github+json"
|
|
|
+ $api = "X-GitHub-Api-Version: 2022-11-28"
|
|
|
+ #$url = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases/tags/v${{ env.RELEASE_VERSION }} >$null 2>&1) | ConvertFrom-Json -AsHashtable -ErrorAction SilentlyContinue
|
|
|
+ $json = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases) | ConvertFrom-Json
|
|
|
+ $tagExists = ($json.GetEnumerator() | Where-Object { $_.tag_name -eq 'v3.19.2' }) -ne $null
|
|
|
+ if ( $tagExists -eq $true ) {
|
|
|
$sha = (git rev-parse --verify HEAD)
|
|
|
- gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.REPOSITORY }}/releases -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish="$sha" -f name='v${{ env.RELEASE_VERSION }}' -F draft=true -F prerelease=false -F generate_release_notes=true
|
|
|
+ gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish="$sha" -f name='v${{ env.RELEASE_VERSION }}' -F draft=true -F prerelease=false -F generate_release_notes=true
|
|
|
#gh release create v${{ env.RELEASE_VERSION }} --generate-notes -f target_commitish='master' --draft -R ${{ env.REPO_SELF }}
|
|
|
}
|
|
|
gh release upload 'v${{ env.RELEASE_VERSION }}' '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' '${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' --clobber -R ${{ env.REPO_SELF }}
|