diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9edb10872c..9fa27bf394 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -217,18 +217,15 @@ jobs: aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-dns-server s3://vorc/iroh-dns-server-${RELEASE_OS}-${RELEASE_ARCH}-latest --no-progress - name: Build archives + if: matrix.os != 'windows-latest' shell: bash run: | - pwd - ls IFS=',' read -ra BIN_NAMES <<< "${{ env.BIN_NAMES }}" ASSETS="" for BIN_NAME in "${BIN_NAMES[@]}"; do staging="$BIN_NAME-${{ needs.create-release.outputs.release_version }}-${{ matrix.cargo_targets }}" - echo "$staging" mkdir -p "$staging" if [ "${{ matrix.os }}" = "windows-latest" ]; then - echo "windows" cp "target/${{ matrix.cargo_targets }}/optimized-release/$BIN_NAME.exe" "$staging/" cd "$staging" zip -r "../$staging.zip" . @@ -241,6 +238,24 @@ jobs: fi done echo "ASSET=$(echo $ASSETS | sed 's/,$//')" >> $GITHUB_ENV + + - name: Build archives (windows) + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + $BIN_NAMES = "${{ env.BIN_NAMES }}".Split(',') + $ASSETS = @() + foreach ($BIN_NAME in $BIN_NAMES) { + $staging = "$BIN_NAME-${{ needs.create-release.outputs.release_version }}-${{ matrix.cargo_targets }}" + New-Item -ItemType Directory -Force -Path "$staging" + Copy-Item -Path "target/${{ matrix.cargo_targets }}/optimized-release/$BIN_NAME.exe" -Destination "$staging/" + Set-Location -Path "$staging" + Compress-Archive -Path * -DestinationPath "../$staging.zip" + $ASSETS += "$staging.zip" + Set-Location -Path .. + } + $ASSETS = $ASSETS -join ',' + Write-Host "ASSET=$ASSETS" | Out-File -Append -FilePath $env:GITHUB_ENV - name: Install file shell: bash