@@ -1019,12 +1019,15 @@ jobs:
1019
1019
env :
1020
1020
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1021
1021
run : |
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 }}
1022
+ function upload_installer( ) {
1023
+ local input_file=$1
1024
+ local output_name=$2
1025
1025
1026
- shasum -a 256 "${OutputName}" > "${OutputName}.sha256"
1027
- gh release upload ${{ needs.context.outputs.swift_tag }} "${OutputName}.sha256" -R ${{ github.repository }}
1026
+ mv "${input_file}" "${output_name}"
1027
+ gh release upload ${{ needs.context.outputs.swift_tag }} "${output_name}" -R ${{ github.repository }}
1028
+
1029
+ shasum -a 256 "${output_name}" > "${output_name}.sha256"
1030
+ gh release upload ${{ needs.context.outputs.swift_tag }} "${output_name}.sha256" -R ${{ github.repository }}
1028
1031
}
1029
1032
1030
1033
branch_version_string=${{ inputs.swift_version || '0.0.0' }}
@@ -1038,21 +1041,7 @@ jobs:
1038
1041
gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} --latest=${latest}
1039
1042
1040
1043
# 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"
1045
-
1046
- binary-size :
1047
- needs : [context, release]
1048
- if : inputs.create_release == true
1049
- name : Record Swift Toolchain Binary Sizes
1050
- permissions :
1051
- contents : read
1052
- id-token : write
1053
- uses : ./.github/workflows/release-swift-toolchain-binary-sizes.yml
1054
- with :
1055
- toolchain_version : ${{ needs.context.outputs.swift_tag }}
1056
- dry_run : false
1057
- secrets :
1058
- SWIFT_TOOLCHAIN_UPLOADER_ROLE_ARN : ${{ secrets.SWIFT_TOOLCHAIN_UPLOADER_ROLE_ARN }}
1044
+ upload_installer "${{ github.workspace }}/tmp/online/amd64/installer.exe" "installer-amd64.exe"
1045
+ upload_installer "${{ github.workspace }}/tmp/online/arm64/installer.exe" "installer-arm64.exe"
1046
+ upload_installer "${{ github.workspace }}/tmp/offline/amd64/installer.exe" "installer-offline-amd64.exe"
1047
+ upload_installer "${{ github.workspace }}/tmp/offline/arm64/installer.exe" "installer-offline-arm64.exe"
0 commit comments