283
283
required : true
284
284
PASSPHRASE :
285
285
required : true
286
+ R2_ACCOUNT_ID :
287
+ required : true
288
+ R2_ACCESS_KEY_ID :
289
+ required : true
290
+ R2_SECRET_ACCESS_KEY :
291
+ required : true
286
292
287
293
env :
288
294
PINNED_BOOTSTRAP_TOOLCHAIN_VERSION : 6.1.2
@@ -2169,7 +2175,7 @@ jobs:
2169
2175
run : |
2170
2176
cd ${{ github.workspace }}/SourceCache/swift/Runtimes
2171
2177
cmake -P Resync.cmake
2172
-
2178
+
2173
2179
- name : Configure Dispatch (C parts only)
2174
2180
if : matrix.os != 'Android' || inputs.build_android
2175
2181
uses : ./SourceCache/ci-build/.github/actions/configure-cmake-project
@@ -5068,7 +5074,7 @@ jobs:
5068
5074
-p:ProductVersion=${{ inputs.swift_version }}-${{ inputs.swift_tag }} `
5069
5075
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/shared/shared.wixproj
5070
5076
5071
- - name : Build installer bundle
5077
+ - name : Build installer bundle (offline)
5072
5078
run : |
5073
5079
$Platforms=@("windows")
5074
5080
if ("${{ inputs.build_android }}" -eq "true") {
@@ -5091,16 +5097,93 @@ jobs:
5091
5097
-p:ToolchainVariants="`"asserts;noasserts`"" `
5092
5098
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bundle/installer.wixproj
5093
5099
5094
- - if : ${{ inputs.release }}
5100
+ - name : Generate Build Provenance (offline installer)
5101
+ if : ${{ inputs.release }}
5095
5102
uses : actions/attest-build-provenance@v2
5096
5103
with :
5097
5104
subject-path : ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/installer.exe
5098
5105
5099
- - uses : actions/upload-artifact@v4
5106
+ - name : Upload installer (offline)
5107
+ uses : actions/upload-artifact@v4
5108
+ with :
5109
+ name : Windows-${{ matrix.arch }}-installer-offline
5110
+ path : ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/installer.exe
5111
+
5112
+ - name : Generate online installer download URL
5113
+ if : ${{ inputs.release }}
5114
+ id : generate-base-release-download-prefix
5115
+ run : |
5116
+ $BaseReleaseDownloadUrlPrefix = "${{ inputs.swift_tag }}/${{ matrix.arch }}/${{ github.run_id }}"
5117
+ echo "url_prefix=$BaseReleaseDownloadUrlPrefix" >> $env:GITHUB_OUTPUT
5118
+
5119
+ - name : Build installer bundle (online)
5120
+ if : ${{ inputs.release }}
5121
+ run : |
5122
+ $Platforms=@("windows")
5123
+ if ("${{ inputs.build_android }}" -eq "true") {
5124
+ $Platforms=@("android") + $Platforms
5125
+ }
5126
+ $BaseReleaseDownloadUrl = "https://pub-3a06d9ae9ab6469198a3cf59c7d6bdce.r2.dev/${{ steps.generate-base-release-download-prefix.outputs.url_prefix }}"
5127
+
5128
+ msbuild -nologo -restore -maxCpuCount `
5129
+ /t:rebuild `
5130
+ -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
5131
+ -p:Configuration=Release `
5132
+ -p:BuildProjectReferences=false `
5133
+ -p:SignOutput=${{ inputs.signed }} `
5134
+ -p:CERTIFICATE=${env:CERTIFICATE} `
5135
+ -p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
5136
+ -p:BundleFlavor=online `
5137
+ -p:BaseReleaseDownloadUrl=`"$BaseReleaseDownloadUrl`" `
5138
+ -p:Platforms="`"$($Platforms -Join ';')`"" `
5139
+ -p:AndroidArchitectures="`"aarch64;armv7;i686;x86_64`"" `
5140
+ -p:WindowsArchitectures="`"aarch64;i686;x86_64`"" `
5141
+ -p:ProductArchitecture=${{ matrix.arch }} `
5142
+ -p:ProductVersion=${{ inputs.swift_version }}-${{ inputs.swift_tag }} `
5143
+ -p:ToolchainVariants="`"asserts;noasserts`"" `
5144
+ ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bundle/installer.wixproj
5145
+
5146
+ - name : Prepare layout for upload
5147
+ id : prepare-layout
5148
+ if : ${{ inputs.release }}
5149
+ run : |
5150
+ # Create the target folder.
5151
+ $SourceDir = "${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}"
5152
+ $LayoutDir = "${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/layout"
5153
+ New-Item -ItemType Directory -Path $LayoutDir -Force | Out-Null
5154
+
5155
+ # Copy all .txt files from src to the filtered directory
5156
+ Copy-Item -Path "$SourceDir/installer.exe" -Destination "$LayoutDir" -Force
5157
+ Copy-Item -Path "$SourceDir/*.cab" -Destination "$LayoutDir" -Force
5158
+ Copy-Item -Path "$SourceDir/*.msi" -Destination "$LayoutDir" -Force
5159
+
5160
+ echo "LayoutDir=$LayoutDir"
5161
+ echo "LayoutDir=$LayoutDir" >> $env:GITHUB_OUTPUT
5162
+
5163
+ - name : Generate Build Provenance (online installer)
5164
+ if : ${{ inputs.release }}
5165
+ uses : actions/attest-build-provenance@v2
5166
+ with :
5167
+ subject-path : ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/installer.exe
5168
+
5169
+ - name : Upload installer (online)
5170
+ if : ${{ inputs.release }}
5171
+ uses : actions/upload-artifact@v4
5100
5172
with :
5101
5173
name : Windows-${{ matrix.arch }}-installer
5102
5174
path : ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/installer.exe
5103
5175
5176
+ - name : Upload msi's and cab's
5177
+ if : ${{ inputs.release }}
5178
+ uses : ryand56/r2-upload-action@b801a390acbdeb034c5e684ff5e1361c06639e7c # v1.4
5179
+ with :
5180
+ r2-account-id : ${{ secrets.R2_ACCOUNT_ID }}
5181
+ r2-access-key-id : ${{ secrets.R2_ACCESS_KEY_ID }}
5182
+ r2-secret-access-key : ${{ secrets.R2_SECRET_ACCESS_KEY }}
5183
+ r2-bucket : swift-toolchain
5184
+ source-dir : ${{ steps.prepare-layout.outputs.LayoutDir }}
5185
+ destination-dir : ${{ steps.generate-base-release-download-prefix.outputs.url_prefix }}
5186
+
5104
5187
smoke_test :
5105
5188
# TODO: Build this on macOS or make an equivalent Mac-only job
5106
5189
if : inputs.build_os == 'Windows'
@@ -5110,7 +5193,7 @@ jobs:
5110
5193
steps :
5111
5194
- uses : actions/download-artifact@v4
5112
5195
with :
5113
- name : Windows-${{ inputs.build_arch }}-installer
5196
+ name : Windows-${{ inputs.build_arch }}-installer-offline
5114
5197
path : ${{ github.workspace }}/tmp
5115
5198
5116
5199
# TODO(compnerd): migrate this to compnerd/gha-setup-swift after the work that @mangini is doing is completed
@@ -5175,7 +5258,7 @@ jobs:
5175
5258
- name : Download Swift SDK
5176
5259
uses : actions/download-artifact@v4
5177
5260
with :
5178
- name : Windows-${{ inputs.build_arch }}-installer
5261
+ name : Windows-${{ inputs.build_arch }}-installer-offline
5179
5262
path : ${{ github.workspace }}/tmp
5180
5263
5181
5264
# TODO(compnerd): migrate this to compnerd/gha-setup-swift after the work that @mangini is doing is completed
0 commit comments