diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index be8ba0b..72f5f87 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -55,12 +55,24 @@ jobs: "orion-macos" ) - # Create release - gh release create ${{ github.ref_name }} \ - --title "Release ${{ github.ref_name }}" \ - --notes "Release ${{ github.ref_name }}" + # Check if release exists + if gh release view ${{ github.ref_name }} &>/dev/null; then + echo "Release ${{ github.ref_name }} already exists. Updating..." + gh release edit ${{ github.ref_name }} \ + --title "Release ${{ github.ref_name }}" \ + --notes "Release ${{ github.ref_name }} (updated)" + else + echo "Creating new release ${{ github.ref_name }}..." + gh release create ${{ github.ref_name }} \ + --title "Release ${{ github.ref_name }}" \ + --notes "Release ${{ github.ref_name }}" + fi # Upload assets for asset in "${assets[@]}"; do - gh release upload ${{ github.ref_name }} "$asset" + if [ -f "$asset" ]; then + gh release upload ${{ github.ref_name }} "$asset" --clobber + else + echo "Warning: Asset $asset not found" + fi done \ No newline at end of file