From 269d26e0bec722dc4390dbd7e23452a32d133a09 Mon Sep 17 00:00:00 2001 From: Asmir Avdicevic Date: Wed, 24 Apr 2024 14:05:19 +0200 Subject: [PATCH] test --- .github/workflows/release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b8498ef5a..df37595e48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -255,7 +255,7 @@ jobs: run: sudo apt update && sudo apt install -y file - name: Upload release archives - if: github.event.inputs.upload_artifacts == 'true' || github.event_name == 'push' + if: matrix.os != 'windows-latest' && (github.event.inputs.upload_artifacts == 'true' || github.event_name == 'push') shell: bash run: | IFS=',' read -ra ASSETS <<< "${{ env.ASSET }}" @@ -266,4 +266,18 @@ jobs: -H "Content-Type: $(file -b --mime-type $ASSET)" \ --data-binary @"$ASSET" \ "${{ needs.create-release.outputs.upload_url }}=$ASSET_NAME" - done \ No newline at end of file + done + + - name: Upload release archives + if: matrix.os == 'windows-latest' && (github.event.inputs.upload_artifacts == 'true' || github.event_name == 'push') + shell: pwsh + run: | + $ASSETS = "${{ env.ASSET }}".Split(',') + foreach ($ASSET in $ASSETS) { + $ASSET_NAME = Split-Path $ASSET -Leaf + $uploadUrl = "${{ needs.create-release.outputs.upload_url }}=$ASSET_NAME" + $command = 'curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: multipart/form-data" --data-binary "@' + $ASSET + '" ' + $uploadUrl + Invoke-Expression $command + } + + \ No newline at end of file