|
| 1 | +name: Development Snapshot |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + swift_version: |
| 7 | + description: 'Swift Version' |
| 8 | + default: '0.0.0' |
| 9 | + required: false |
| 10 | + type: string |
| 11 | + |
| 12 | + android_api_level: |
| 13 | + description: 'Android API Level' |
| 14 | + default: 28 |
| 15 | + required: false |
| 16 | + type: number |
| 17 | + |
| 18 | + swift_tag: |
| 19 | + description: 'Swift Build Tag' |
| 20 | + required: false |
| 21 | + type: string |
| 22 | + |
| 23 | + debug_info: |
| 24 | + description: 'Emit PDBs (Debug Info)' |
| 25 | + default: false |
| 26 | + type: boolean |
| 27 | + |
| 28 | + signed: |
| 29 | + description: 'Code Sign' |
| 30 | + default: false |
| 31 | + type: boolean |
| 32 | + |
| 33 | + create_release: |
| 34 | + description: 'Create Release' |
| 35 | + type: boolean |
| 36 | + default: true |
| 37 | + required: false |
| 38 | + |
| 39 | + workflow_call: |
| 40 | + inputs: |
| 41 | + swift_version: |
| 42 | + description: 'Swift Version' |
| 43 | + default: '0.0.0' |
| 44 | + required: false |
| 45 | + type: string |
| 46 | + |
| 47 | + android_api_level: |
| 48 | + description: 'Android API Level' |
| 49 | + default: 28 |
| 50 | + required: false |
| 51 | + type: number |
| 52 | + |
| 53 | + swift_tag: |
| 54 | + description: 'Swift Build Tag' |
| 55 | + required: false |
| 56 | + type: string |
| 57 | + |
| 58 | + debug_info: |
| 59 | + description: 'Emit PDBs (Debug Info)' |
| 60 | + default: true |
| 61 | + type: boolean |
| 62 | + |
| 63 | + signed: |
| 64 | + description: 'Code Sign' |
| 65 | + default: false |
| 66 | + type: boolean |
| 67 | + |
| 68 | + create_release: |
| 69 | + description: 'Create Release' |
| 70 | + type: boolean |
| 71 | + default: true |
| 72 | + required: false |
| 73 | + |
| 74 | + secrets: |
| 75 | + SYMBOL_SERVER_PAT: |
| 76 | + required: true |
| 77 | + CERTIFICATE: |
| 78 | + required: true |
| 79 | + PASSPHRASE: |
| 80 | + required: true |
| 81 | + |
| 82 | +env: |
| 83 | + SCCACHE_DIRECT: yes |
| 84 | + |
| 85 | +jobs: |
| 86 | + context: |
| 87 | + runs-on: ubuntu-latest |
| 88 | + outputs: |
| 89 | + curl_revision: ${{ steps.context.outputs.curl_revision }} |
| 90 | + indexstore_db_revision: ${{ steps.context.outputs.indexstore_db_revision }} |
| 91 | + libxml2_revision: ${{ steps.context.outputs.libxml2_revision }} |
| 92 | + llvm_project_revision: ${{ steps.context.outputs.llvm_project_revision }} |
| 93 | + sourcekit_lsp_revision: ${{ steps.context.outputs.sourcekit_lsp_revision }} |
| 94 | + swift_argument_parser_revision: ${{ steps.context.outputs.swift_argument_parser_revision }} |
| 95 | + swift_asn1_revision: ${{ steps.context.outputs.swift_asn1_revision }} |
| 96 | + swift_atomics_revision: ${{ steps.context.outputs.swift_atomics_revision }} |
| 97 | + swift_certificates_revision: ${{ steps.context.outputs.swift_certificates_revision }} |
| 98 | + swift_cmark_revision: ${{ steps.context.outputs.swift_cmark_revision }} |
| 99 | + swift_collections_revision: ${{ steps.context.outputs.swift_collections_revision }} |
| 100 | + swift_corelibs_foundation_revision: ${{ steps.context.outputs.swift_corelibs_foundation_revision }} |
| 101 | + swift_corelibs_libdispatch_revision: ${{ steps.context.outputs.swift_corelibs_libdispatch_revision }} |
| 102 | + swift_corelibs_xctest_revision: ${{ steps.context.outputs.swift_corelibs_xctest_revision }} |
| 103 | + swift_crypto_revision: ${{ steps.context.outputs.swift_crypto_revision }} |
| 104 | + swift_driver_revision: ${{ steps.context.outputs.swift_driver_revision }} |
| 105 | + swift_experimental_string_processing_revision: ${{ steps.context.outputs.swift_experimental_string_processing_revision }} |
| 106 | + swift_format_revision: ${{ steps.context.outputs.swift_format_revision }} |
| 107 | + swift_foundation_revision: ${{ steps.context.outputs.swift_foundation_revision }} |
| 108 | + swift_foundation_icu_revision: ${{ steps.context.outputs.swift_foundation_icu_revision }} |
| 109 | + swift_installer_scripts_revision: ${{ steps.context.outputs.swift_installer_scripts_revision }} |
| 110 | + swift_llbuild_revision: ${{ steps.context.outputs.swift_llbuild_revision }} |
| 111 | + swift_markdown_revision: ${{ steps.context.outputs.swift_markdown_revision }} |
| 112 | + swift_package_manager_revision: ${{ steps.context.outputs.swift_package_manager_revision }} |
| 113 | + swift_revision: ${{ steps.context.outputs.swift_revision }} |
| 114 | + swift_syntax_revision: ${{ steps.context.outputs.swift_syntax_revision }} |
| 115 | + swift_system_revision: ${{ steps.context.outputs.swift_system_revision }} |
| 116 | + swift_toolchain_sqlite_revision: ${{ steps.context.outputs.swift_toolchain_sqlite_revision }} |
| 117 | + swift_toolchain_sqlite_version: ${{ steps.context.outputs.swift_toolchain_sqlite_version }} |
| 118 | + swift_tools_support_core_revision: ${{ steps.context.outputs.swift_tools_support_core_revision }} |
| 119 | + yams_revision: ${{ steps.context.outputs.yams_revision }} |
| 120 | + zlib_revision: ${{ steps.context.outputs.zlib_revision }} |
| 121 | + ANDROID_API_LEVEL: ${{ steps.context.outputs.ANDROID_API_LEVEL }} |
| 122 | + WINDOWS_CMAKE_C_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }} |
| 123 | + WINDOWS_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} |
| 124 | + WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }} |
| 125 | + WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }} |
| 126 | + ANDROID_CMAKE_C_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }} |
| 127 | + ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} |
| 128 | + ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }} |
| 129 | + ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }} |
| 130 | + CMAKE_Swift_FLAGS: ${{ steps.context.outputs.CMAKE_Swift_FLAGS }} |
| 131 | + debug_info: ${{ steps.context.outputs.debug_info }} |
| 132 | + signed: ${{ steps.context.outputs.signed }} |
| 133 | + swift_version: ${{ steps.context.outputs.swift_version }} |
| 134 | + swift_tag: ${{ steps.context.outputs.swift_tag }} |
| 135 | + windows_build_runner: ${{ steps.context.outputs.windows_build_runner }} |
| 136 | + compilers_build_runner: ${{ steps.context.outputs.compilers_build_runner }} |
| 137 | + steps: |
| 138 | + - id: context |
| 139 | + name: Generate Build Context |
| 140 | + run: | |
| 141 | + # TODO(compnerd) can we make this more silent? |
| 142 | + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -yq |
| 143 | + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -o Dpkg::Use-Pty=0 install -yq repo libxml2-utils |
| 144 | +
|
| 145 | + # Which branch is this workflow based on |
| 146 | + branch_version_string=${{ inputs.swift_version || '0.0.0' }} |
| 147 | + if [[ $branch_version_string == *.* ]]; then |
| 148 | + branch_name=$(echo ${branch_version_string} | awk -F. '{ ver=$1"."$2; print (ver == "0.0") ? "main" : "release/"ver }') |
| 149 | + else |
| 150 | + branch_name="release/$branch_version_string" |
| 151 | + fi |
| 152 | +
|
| 153 | + repo init --quiet --groups default --depth 1 -u https://github.com/compnerd/swift-build -b $branch_name |
| 154 | + repo sync --quiet --no-clone-bundle --no-tags --jobs $(nproc --all) |
| 155 | +
|
| 156 | + if [[ "${{ inputs.swift_tag }}" != "" ]] ; then |
| 157 | + tee -a "${GITHUB_OUTPUT}" <<-EOF |
| 158 | + indexstore_db_revision=refs/tags/${{ inputs.swift_tag }} |
| 159 | + llvm_project_revision=refs/tags/${{ inputs.swift_tag }} |
| 160 | + sourcekit_lsp_revision=refs/tags/${{ inputs.swift_tag }} |
| 161 | + swift_revision=refs/tags/${{ inputs.swift_tag }} |
| 162 | + swift_argument_parser_revision=refs/tags/1.4.0 |
| 163 | + swift_asn1_revision=refs/tags/0.7.0 |
| 164 | + swift_atomics_revision=refs/tags/1.2.0 |
| 165 | + swift_certificates_revision=refs/tags/0.1.0 |
| 166 | + swift_cmark_revision=refs/tags/${{ inputs.swift_tag }} |
| 167 | + swift_collections_revision=refs/tags/1.1.2 |
| 168 | + swift_corelibs_foundation_revision=refs/tags/${{ inputs.swift_tag }} |
| 169 | + swift_corelibs_libdispatch_revision=refs/tags/${{ inputs.swift_tag }} |
| 170 | + swift_corelibs_xctest_revision=refs/tags/${{ inputs.swift_tag }} |
| 171 | + swift_crypto_revision=refs/tags/3.0.0 |
| 172 | + swift_driver_revision=refs/tags/${{ inputs.swift_tag }} |
| 173 | + swift_experimental_string_processing_revision=refs/tags/${{ inputs.swift_tag }} |
| 174 | + swift_format_revision=refs/heads/main |
| 175 | + swift_foundation_revison=refs/heads/main |
| 176 | + swift_foundation_icu_revision=refs/tags/0.0.8 |
| 177 | + swift_installer_scripts_revision=refs/heads/main |
| 178 | + swift_llbuild_revision=refs/tags/${{ inputs.swift_tag }} |
| 179 | + swift_markdown_revision=refs/tags/${{ inputs.swift_tag }} |
| 180 | + swift_package_manager_revision=refs/tags/${{ inputs.swift_tag }} |
| 181 | + swift_syntax_revision=refs/tags/${{ inputs.swift_tag }} |
| 182 | + swift_system_revision=refs/tags/1.3.0 |
| 183 | + swift_toolchain_sqlite_revision=refs/tags/main |
| 184 | + swift_toolchain_sqlite_version=3.46.0 |
| 185 | + swift_tools_support_core_revision=refs/tags/${{ inputs.swift_tag }} |
| 186 | + curl_revision=refs/tags/curl-8_5_0 |
| 187 | + libxml2_revision=refs/tags/v2.11.5 |
| 188 | + yams_revision=refs/tags/5.0.6 |
| 189 | + zlib_revision=refs/tags/v1.3.1 |
| 190 | + EOF |
| 191 | + else |
| 192 | + repo manifest -r --suppress-upstream-revision --suppress-dest-branch | \ |
| 193 | + xmllint --xpath "//project/@name | //project/@revision" - | \ |
| 194 | + xargs -n2 | \ |
| 195 | + awk -F'[= ]' '{ |
| 196 | + split($2, repo, "/"); |
| 197 | + gsub(/-/, "_", repo[2]); |
| 198 | + print tolower(repo[2]) "_revision=" $4 |
| 199 | + }' | tee -a "${GITHUB_OUTPUT}" |
| 200 | + repo manifest -r --suppress-upstream-revision --suppress-dest-branch -o - | sed -E 's,[[:space:]]+$,,' > stable.xml |
| 201 | + fi |
| 202 | +
|
| 203 | + # FIXME(z2oh): Remove /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR when GitHub runner image updates to 20240610.1. |
| 204 | + # see: https://github.com/actions/runner-images/issues/10004 |
| 205 | + if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.debug_info }}" == "true" ]]; then |
| 206 | + echo debug_info=true >> ${GITHUB_OUTPUT} |
| 207 | + echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} |
| 208 | + echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} |
| 209 | + echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} |
| 210 | + echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} |
| 211 | + echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} |
| 212 | + echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} |
| 213 | + echo CMAKE_Swift_FLAGS="-g -debug-info-format=codeview -Xlinker -debug -Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} |
| 214 | + else |
| 215 | + echo debug_info=false >> ${GITHUB_OUTPUT} |
| 216 | + echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} |
| 217 | + echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} |
| 218 | + echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} |
| 219 | + echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} |
| 220 | + echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} |
| 221 | + echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} |
| 222 | + echo CMAKE_Swift_FLAGS="-Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} |
| 223 | + fi |
| 224 | + echo ANDROID_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} |
| 225 | + echo ANDROID_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} |
| 226 | +
|
| 227 | + if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.signed }}" == "true" ]]; then |
| 228 | + # FIXME(compnerd) enable this when requested |
| 229 | + echo signed=false >> ${GITHUB_OUTPUT} |
| 230 | + else |
| 231 | + echo signed=false >> ${GITHUB_OUTPUT} |
| 232 | + fi |
| 233 | +
|
| 234 | + echo swift_version=${{ inputs.swift_version || '0.0.0' }} | tee -a ${GITHUB_OUTPUT} |
| 235 | + if [[ -n "${{ inputs.swift_tag }}" ]] ; then |
| 236 | + echo swift_tag=${{ inputs.swift_tag }} | tee -a ${GITHUB_OUTPUT} |
| 237 | + else |
| 238 | + if [[ "$branch_name" == "main" ]] ; then |
| 239 | + echo swift_tag=$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} |
| 240 | + else |
| 241 | + echo swift_tag=swift-"$branch_version_string"-$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} |
| 242 | + fi |
| 243 | + fi |
| 244 | +
|
| 245 | + echo windows_build_runner=${{ vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} |
| 246 | + echo compilers_build_runner=${{ vars.COMPILERS_BUILD_RUNNER || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} |
| 247 | +
|
| 248 | + echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT} |
| 249 | +
|
| 250 | + - uses: actions/upload-artifact@v4 |
| 251 | + with: |
| 252 | + name: stable.xml |
| 253 | + path: stable.xml |
| 254 | + if-no-files-found: ignore |
| 255 | + |
| 256 | + windows-build: |
| 257 | + needs: [context] |
| 258 | + name: Windows Swift Toolchains Build |
| 259 | + uses: ./.github/workflows/swift-toolchain.yml |
| 260 | + with: |
| 261 | + curl_revision: ${{ needs.context.outputs.curl_revision }} |
| 262 | + indexstore_db_revision: ${{ needs.context.outputs.indexstore_db_revision }} |
| 263 | + libxml2_revision: ${{ needs.context.outputs.libxml2_revision }} |
| 264 | + llvm_project_revision: ${{ needs.context.outputs.llvm_project_revision }} |
| 265 | + sourcekit_lsp_revision: ${{ needs.context.outputs.sourcekit_lsp_revision }} |
| 266 | + swift_argument_parser_revision: ${{ needs.context.outputs.swift_argument_parser_revision }} |
| 267 | + swift_asn1_revision: ${{ needs.context.outputs.swift_asn1_revision }} |
| 268 | + swift_atomics_revision: ${{ needs.context.outputs.swift_atomics_revision }} |
| 269 | + swift_certificates_revision: ${{ needs.context.outputs.swift_certificates_revision }} |
| 270 | + swift_cmark_revision: ${{ needs.context.outputs.swift_cmark_revision }} |
| 271 | + swift_collections_revision: ${{ needs.context.outputs.swift_collections_revision }} |
| 272 | + swift_corelibs_foundation_revision: ${{ needs.context.outputs.swift_corelibs_foundation_revision }} |
| 273 | + swift_corelibs_libdispatch_revision: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }} |
| 274 | + swift_corelibs_xctest_revision: ${{ needs.context.outputs.swift_corelibs_xctest_revision }} |
| 275 | + swift_crypto_revision: ${{ needs.context.outputs.swift_crypto_revision }} |
| 276 | + swift_driver_revision: ${{ needs.context.outputs.swift_driver_revision }} |
| 277 | + swift_experimental_string_processing_revision: ${{ needs.context.outputs.swift_experimental_string_processing_revision }} |
| 278 | + swift_format_revision: ${{ needs.context.outputs.swift_format_revision }} |
| 279 | + swift_foundation_revision: ${{ needs.context.outputs.swift_foundation_revision }} |
| 280 | + swift_foundation_icu_revision: ${{ needs.context.outputs.swift_foundation_icu_revision }} |
| 281 | + swift_installer_scripts_revision: ${{ needs.context.outputs.swift_installer_scripts_revision }} |
| 282 | + swift_llbuild_revision: ${{ needs.context.outputs.swift_llbuild_revision }} |
| 283 | + swift_markdown_revision: ${{ needs.context.outputs.swift_markdown_revision }} |
| 284 | + swift_package_manager_revision: ${{ needs.context.outputs.swift_package_manager_revision }} |
| 285 | + swift_revision: ${{ needs.context.outputs.swift_revision }} |
| 286 | + swift_syntax_revision: ${{ needs.context.outputs.swift_syntax_revision }} |
| 287 | + swift_system_revision: ${{ needs.context.outputs.swift_system_revision }} |
| 288 | + swift_toolchain_sqlite_revision: ${{ needs.context.outputs.swift_toolchain_sqlite_revision }} |
| 289 | + swift_toolchain_sqlite_version: ${{ needs.context.outputs.swift_toolchain_sqlite_version }} |
| 290 | + swift_tools_support_core_revision: ${{ needs.context.outputs.swift_tools_support_core_revision }} |
| 291 | + yams_revision: ${{ needs.context.outputs.yams_revision }} |
| 292 | + zlib_revision: ${{ needs.context.outputs.zlib_revision }} |
| 293 | + ANDROID_API_LEVEL: ${{ needs.context.outputs.ANDROID_API_LEVEL }} |
| 294 | + WINDOWS_CMAKE_C_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} |
| 295 | + WINDOWS_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} |
| 296 | + WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }} |
| 297 | + WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }} |
| 298 | + ANDROID_CMAKE_C_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} |
| 299 | + ANDROID_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} |
| 300 | + ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }} |
| 301 | + ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }} |
| 302 | + CMAKE_Swift_FLAGS: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} |
| 303 | + debug_info: ${{ needs.context.outputs.debug_info }} |
| 304 | + signed: ${{ needs.context.outputs.signed }} |
| 305 | + swift_version: ${{ needs.context.outputs.swift_version }} |
| 306 | + swift_tag: ${{ needs.context.outputs.swift_tag }} |
| 307 | + default_build_runner: ${{ needs.context.outputs.windows_build_runner }} |
| 308 | + compilers_build_runner: ${{ needs.context.outputs.compilers_build_runner }} |
| 309 | + secrets: |
| 310 | + SYMBOL_SERVER_PAT: ${{ secrets.SYMBOL_SERVER_PAT }} |
| 311 | + CERTIFICATE: ${{ secrets.CERTIFICATE }} |
| 312 | + PASSPHRASE: ${{ secrets.PASSPHRASE }} |
| 313 | + |
| 314 | + snapshot: |
| 315 | + runs-on: ubuntu-latest |
| 316 | + needs: [context, windows-build] |
| 317 | + if: github.event_name == 'schedule' |
| 318 | + steps: |
| 319 | + - uses: actions/checkout@v4 |
| 320 | + with: |
| 321 | + ref: refs/heads/main |
| 322 | + show-progress: false |
| 323 | + |
| 324 | + - uses: actions/download-artifact@v4 |
| 325 | + with: |
| 326 | + name: stable.xml |
| 327 | + |
| 328 | + - run: | |
| 329 | + git config --global user.name 'github-action[bot]' |
| 330 | + git config --global user.email 'github-actions[bot]@users.noreply.github.com' |
| 331 | + if ! git diff --exit-code ; then |
| 332 | + git add stable.xml |
| 333 | + git commit -m "repo: update stable revision snapshot ${{ needs.context.outputs.swift_tag }}" |
| 334 | + git push origin HEAD:main |
| 335 | + fi |
| 336 | +
|
| 337 | + release: |
| 338 | + runs-on: ubuntu-latest |
| 339 | + needs: [context, windows-build] |
| 340 | + if: inputs.create_release == true |
| 341 | + steps: |
| 342 | + - uses: actions/download-artifact@v4 |
| 343 | + with: |
| 344 | + name: installer-amd64 |
| 345 | + path: ${{ github.workspace }}/tmp/amd64 |
| 346 | + |
| 347 | + - uses: actions/download-artifact@v4 |
| 348 | + with: |
| 349 | + name: installer-arm64 |
| 350 | + path: ${{ github.workspace }}/tmp/arm64 |
| 351 | + |
| 352 | + - name: Create Release |
| 353 | + env: |
| 354 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 355 | + run: | |
| 356 | + branch_version_string=${{ inputs.swift_version || '0.0.0' }} |
| 357 | + if [[ $branch_version_string == "0.0.0" ]]; then |
| 358 | + latest="true" |
| 359 | + else |
| 360 | + latest="false" |
| 361 | + fi |
| 362 | + # Create Release |
| 363 | + gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} --latest=${latest} |
| 364 | +
|
| 365 | + # AMD64 |
| 366 | + cd ${{ github.workspace }}/tmp/amd64 |
| 367 | +
|
| 368 | + mv installer.exe installer-amd64.exe |
| 369 | + gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe -R ${{ github.repository }} |
| 370 | +
|
| 371 | + shasum -a 256 installer-amd64.exe > installer-amd64.exe.sha256 |
| 372 | + gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe.sha256 -R ${{ github.repository }} |
| 373 | +
|
| 374 | + # ARM64 |
| 375 | + cd ${{ github.workspace }}/tmp/arm64 |
| 376 | +
|
| 377 | + mv installer.exe installer-arm64.exe |
| 378 | + gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe -R ${{ github.repository }} |
| 379 | +
|
| 380 | + shasum -a 256 installer-arm64.exe > installer-arm64.exe.sha256 |
| 381 | + gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe.sha256 -R ${{ github.repository }} |
0 commit comments