From aed3d9d71c4e3144d6f35303ba864026792d1d07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= <felix@passcod.name>
Date: Thu, 12 Jan 2023 13:48:03 +1300
Subject: [PATCH] Use release action with explicit support for being called
 multiple times (#693)

---
 .github/workflows/release-build.yml | 39 +++++++++++++----------------
 1 file changed, 17 insertions(+), 22 deletions(-)

diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml
index f4f886f5..add62091 100644
--- a/.github/workflows/release-build.yml
+++ b/.github/workflows/release-build.yml
@@ -52,19 +52,16 @@ jobs:
     - if: runner.os != 'Windows'
       run: ls -shal packages/
 
-    - if: ${{ inputs.publish }}
-      name: Publish release
-      uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
+    - if: inputs.publish
+      name: Upload to release
+      uses: svenstaro/upload-release-action@v2
       with:
-        tag_name: ${{ fromJSON(inputs.publish).version }}
-        name: ${{ fromJSON(inputs.publish).version }}
+        repo_token: ${{ secrets.GITHUB_TOKEN }}
+        tag: v${{ fromJSON(inputs.publish).version }}
         body: ${{ fromJSON(inputs.publish).notes }}
-        append_body: false
-        files: |
-          packages/cargo-binstall-*
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-    - if: ${{ !inputs.publish || runner.os == 'macOS' }}
+        file: packages/cargo-binstall-*
+        file_glob: true
+    - if: "! inputs.publish || runner.os == 'macOS'"
       name: Upload artifact
       uses: actions/upload-artifact@v3
       with:
@@ -98,19 +95,17 @@ jobs:
     - run: just repackage-lipo
     - run: ls -shal packages/
 
-    - if: ${{ inputs.publish }}
-      name: Publish release
-      uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
+    - if: inputs.publish
+      name: Upload to release
+      uses: svenstaro/upload-release-action@v2
       with:
-        tag_name: v${{ fromJSON(inputs.publish).version }}
-        name: v${{ fromJSON(inputs.publish).version }}
+        repo_token: ${{ secrets.GITHUB_TOKEN }}
+        tag: v${{ fromJSON(inputs.publish).version }}
         body: ${{ fromJSON(inputs.publish).notes }}
-        append_body: false
-        files: |
-          packages/cargo-binstall-universal-*
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-    - if: ${{ !inputs.publish }}
+        file: packages/cargo-binstall-universal-*
+        file_glob: true
+        overwrite: true
+    - if: "! inputs.publish"
       name: Upload artifact
       uses: actions/upload-artifact@v3
       with: