Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arqu committed Apr 25, 2024
1 parent 54c34ef commit 0112eb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/scripts/upload_to_gh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
IFS=',' read -ra ASSETS <<< "$3"
url="$2"
url=${url%%\{*}
for ASSET in "${ASSETS[@]}"; do
ASSET_NAME=$(basename $ASSET)
curl \
-H "Authorization: Bearer $1" \
-H "Content-Type: $(file -b --mime-type $ASSET)" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--data-binary @"$ASSET" \
"$url?name=$ASSET_NAME"
done
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ jobs:
- name: Upload release archives
if: (github.event.inputs.upload_artifacts == 'true' || github.event_name == 'push') && matrix.os != 'windows-latest'
shell: bash
run: .github/scripts/upload_gh_asset.sh "${{ secrets.GITHUB_TOKEN }}" "${{ needs.create-release.outputs.upload_url }}" "${{ env.ASSET }}"
run: .github/scripts/upload_to_gh.sh "${{ secrets.GITHUB_TOKEN }}" "${{ needs.create-release.outputs.upload_url }}" "${{ env.ASSET }}"

- name: Upload release archives (windows)
if: (github.event.inputs.upload_artifacts == 'true' || github.event_name == 'push') && matrix.os == 'windows-latest'
# This exists purely because the GH runners don't properly escape the path to the bash script and the WSL fails to run it.
shell: pwsh
run: bash .github/scripts/upload_gh_asset.sh "${{ secrets.GITHUB_TOKEN }}" "${{ needs.create-release.outputs.upload_url }}" "${{ env.ASSET }}"
run: bash .github/scripts/upload_to_gh.sh "${{ secrets.GITHUB_TOKEN }}" "${{ needs.create-release.outputs.upload_url }}" "${{ env.ASSET }}"

0 comments on commit 0112eb4

Please sign in to comment.