Skip to content

Commit 1c89330

Browse files
committed
Upload offline installer to release
1 parent aff336e commit 1c89330

File tree

1 file changed

+14
-36
lines changed

1 file changed

+14
-36
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,51 +1019,29 @@ jobs:
10191019
env:
10201020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10211021
run: |
1022-
# TODO: Upload the offline installer as well.
1022+
function Upload_File_To_Release([string]$InputFile, [string]$OutputName) {
1023+
mv "${InputFile}" "${OutputName}"
1024+
gh release upload ${{ needs.context.outputs.swift_tag }} "${OutputName}" -R ${{ github.repository }}
1025+
1026+
shasum -a 256 "${OutputName}" > "${OutputName}.sha256"
1027+
gh release upload ${{ needs.context.outputs.swift_tag }} "${OutputName}.sha256" -R ${{ github.repository }}
1028+
}
1029+
10231030
branch_version_string=${{ inputs.swift_version || '0.0.0' }}
10241031
if [[ $branch_version_string == "0.0.0" ]]; then
10251032
latest="true"
10261033
else
10271034
latest="false"
10281035
fi
1036+
10291037
# Create Release
10301038
gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} --latest=${latest}
10311039
1032-
# AMD64
1033-
cd ${{ github.workspace }}/tmp/online/amd64
1034-
1035-
mv installer.exe installer-amd64.exe
1036-
gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe -R ${{ github.repository }}
1037-
1038-
shasum -a 256 installer-amd64.exe > installer-amd64.exe.sha256
1039-
gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe.sha256 -R ${{ github.repository }}
1040-
1041-
# ARM64
1042-
cd ${{ github.workspace }}/tmp/online/arm64
1043-
1044-
mv installer.exe installer-arm64.exe
1045-
gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe -R ${{ github.repository }}
1046-
1047-
shasum -a 256 installer-arm64.exe > installer-arm64.exe.sha256
1048-
gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe.sha256 -R ${{ github.repository }}
1049-
1050-
# AMD64
1051-
cd ${{ github.workspace }}/tmp/offline/amd64
1052-
1053-
mv installer.exe installer-offline-amd64.exe
1054-
gh release upload ${{ needs.context.outputs.swift_tag }} installer-offline-amd64.exe -R ${{ github.repository }}
1055-
1056-
shasum -a 256 installer-offline-amd64.exe > installer-offline-amd64.exe.sha256
1057-
gh release upload ${{ needs.context.outputs.swift_tag }} installer-offline-amd64.exe.sha256 -R ${{ github.repository }}
1058-
1059-
# ARM64
1060-
cd ${{ github.workspace }}/tmp/offline/arm64
1061-
1062-
mv installer.exe installer-offline-arm64.exe
1063-
gh release upload ${{ needs.context.outputs.swift_tag }} installer-offline-arm64.exe -R ${{ github.repository }}
1064-
1065-
shasum -a 256 installer-offline-arm64.exe > installer-offline-arm64.exe.sha256
1066-
gh release upload ${{ needs.context.outputs.swift_tag }} installer-offline-arm64.exe.sha256 -R ${{ github.repository }}
1040+
# Upload all installer variants
1041+
Upload_File_To_Release "${{ github.workspace }}/tmp/online/amd64/installer.exe" "installer-amd64.exe"
1042+
Upload_File_To_Release "${{ github.workspace }}/tmp/online/arm64/installer.exe" "installer-arm64.exe"
1043+
Upload_File_To_Release "${{ github.workspace }}/tmp/offline/amd64/installer.exe" "installer-offline-amd64.exe"
1044+
Upload_File_To_Release "${{ github.workspace }}/tmp/offline/arm64/installer.exe" "installer-offline-arm64.exe"
10671045
10681046
binary-size:
10691047
needs: [context, release]

0 commit comments

Comments
 (0)