@@ -1019,51 +1019,29 @@ jobs:
1019
1019
env :
1020
1020
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1021
1021
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
+
1023
1030
branch_version_string=${{ inputs.swift_version || '0.0.0' }}
1024
1031
if [[ $branch_version_string == "0.0.0" ]]; then
1025
1032
latest="true"
1026
1033
else
1027
1034
latest="false"
1028
1035
fi
1036
+
1029
1037
# Create Release
1030
1038
gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} --latest=${latest}
1031
1039
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"
1067
1045
1068
1046
binary-size :
1069
1047
needs : [context, release]
0 commit comments