Skip to content

Swift Toolchain Build #3046

Swift Toolchain Build

Swift Toolchain Build #3046

name: Development Snapshot
on:
workflow_dispatch:
inputs:
swift_version:
description: 'Swift Version'
default: '0.0.0'
required: false
type: string
android_api_level:
description: 'Android API Level'
default: 28
required: false
type: number
swift_tag:
description: 'Swift Build Tag'
required: false
type: string
debug_info:
description: 'Emit PDBs (Debug Info)'
default: true
type: boolean
signed:
description: 'Code Sign'
default: false
type: boolean
create_release:
description: 'Create Release'
type: boolean
default: true
required: false
default_runner:
description: 'Build runner'
default: 'windows-latest'
required: false
type: string
compilers_runner:
description: 'Build runner for `compilers` job'
type: string
required: false
workflow_call:
inputs:
swift_version:
description: 'Swift Version'
default: '0.0.0'
required: false
type: string
android_api_level:
description: 'Android API Level'
default: 28
required: false
type: number
swift_tag:
description: 'Swift Build Tag'
required: false
type: string
debug_info:
description: 'Emit PDBs (Debug Info)'
default: true
type: boolean
signed:
description: 'Code Sign'
default: false
type: boolean
create_release:
description: 'Create Release'
type: boolean
default: true
required: false
default_runner:
description: 'Build runner'
default: 'windows-latest'
required: false
type: string
compilers_runner:
description: 'Build runner for `compilers` job'
type: string
required: false
secrets:
SYMBOL_SERVER_PAT:
required: true
CERTIFICATE:
required: true
PASSPHRASE:
required: true
env:
SCCACHE_DIRECT: yes
jobs:
context:
runs-on: ubuntu-latest
outputs:
curl_revision: ${{ steps.context.outputs.curl_revision }}
ds2_revision: ${{ steps.context.outputs.ds2_revision }}
icu_revision: ${{ steps.context.outputs.icu_revision }}
indexstore_db_revision: ${{ steps.context.outputs.indexstore_db_revision }}
libxml2_revision: ${{ steps.context.outputs.libxml2_revision }}
llvm_project_revision: ${{ steps.context.outputs.llvm_project_revision }}
sourcekit_lsp_revision: ${{ steps.context.outputs.sourcekit_lsp_revision }}
swift_argument_parser_revision: ${{ steps.context.outputs.swift_argument_parser_revision }}
swift_asn1_revision: ${{ steps.context.outputs.swift_asn1_revision }}
swift_atomics_revision: ${{ steps.context.outputs.swift_atomics_revision }}
swift_certificates_revision: ${{ steps.context.outputs.swift_certificates_revision }}
swift_cmark_revision: ${{ steps.context.outputs.swift_cmark_revision }}
swift_collections_revision: ${{ steps.context.outputs.swift_collections_revision }}
swift_corelibs_foundation_revision: ${{ steps.context.outputs.swift_corelibs_foundation_revision }}
swift_corelibs_libdispatch_revision: ${{ steps.context.outputs.swift_corelibs_libdispatch_revision }}
swift_corelibs_xctest_revision: ${{ steps.context.outputs.swift_corelibs_xctest_revision }}
swift_crypto_revision: ${{ steps.context.outputs.swift_crypto_revision }}
swift_driver_revision: ${{ steps.context.outputs.swift_driver_revision }}
swift_experimental_string_processing_revision: ${{ steps.context.outputs.swift_experimental_string_processing_revision }}
swift_format_revision: ${{ steps.context.outputs.swift_format_revision }}
swift_foundation_revision: ${{ steps.context.outputs.swift_foundation_revision }}
swift_foundation_icu_revision: ${{ steps.context.outputs.swift_foundation_icu_revision }}
swift_installer_scripts_revision: ${{ steps.context.outputs.swift_installer_scripts_revision }}
swift_llbuild_revision: ${{ steps.context.outputs.swift_llbuild_revision }}
swift_markdown_revision: ${{ steps.context.outputs.swift_markdown_revision }}
swift_package_manager_revision: ${{ steps.context.outputs.swift_package_manager_revision }}
swift_revision: ${{ steps.context.outputs.swift_revision }}
swift_syntax_revision: ${{ steps.context.outputs.swift_syntax_revision }}
swift_system_revision: ${{ steps.context.outputs.swift_system_revision }}
swift_tools_support_core_revision: ${{ steps.context.outputs.swift_tools_support_core_revision }}
yams_revision: ${{ steps.context.outputs.yams_revision }}
zlib_revision: ${{ steps.context.outputs.zlib_revision }}
ANDROID_API_LEVEL: ${{ steps.context.outputs.ANDROID_API_LEVEL }}
WINDOWS_CMAKE_C_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
WINDOWS_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}
WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}
ANDROID_CMAKE_C_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}
ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}
CMAKE_Swift_FLAGS: ${{ steps.context.outputs.CMAKE_Swift_FLAGS }}
debug_info: ${{ steps.context.outputs.debug_info }}
signed: ${{ steps.context.outputs.signed }}
swift_version: ${{ steps.context.outputs.swift_version }}
swift_tag: ${{ steps.context.outputs.swift_tag }}
windows_build_runner: ${{ steps.context.outputs.windows_build_runner }}
compilers_build_runner: ${{ steps.context.outputs.compilers_build_runner }}
steps:
- id: context
name: Generate Build Context
run: |
# TODO(compnerd) can we make this more silent?
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -yq
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -o Dpkg::Use-Pty=0 install -yq repo libxml2-utils
# Which branch is this workflow based on
branch_version_string=${{ inputs.swift_version || '0.0.0' }}
if [[ $branch_version_string == *.* ]]; then
branch_name=$(echo ${branch_version_string} | awk -F. '{ ver=$1"."$2; print (ver == "0.0") ? "main" : "release/"ver }')
else
branch_name="release/$branch_version_string"
fi
repo init --quiet --groups default --depth 1 -u https://github.com/compnerd/swift-build -b $branch_name
repo sync --quiet --no-clone-bundle --no-tags --jobs $(nproc --all)
if [[ "${{ inputs.swift_tag }}" != "" ]] ; then
tee -a "${GITHUB_OUTPUT}" <<-EOF
indexstore_db_revision=refs/tags/${{ inputs.swift_tag }}
llvm_project_revision=refs/tags/${{ inputs.swift_tag }}
sourcekit_lsp_revision=refs/tags/${{ inputs.swift_tag }}
swift_revision=refs/tags/${{ inputs.swift_tag }}
swift_argument_parser_revision=refs/tags/1.4.0
swift_asn1_revision=refs/tags/0.7.0
swift_atomics_revision=refs/tags/1.2.0
swift_certificates_revision=refs/tags/0.1.0
swift_cmark_revision=refs/tags/${{ inputs.swift_tag }}
swift_collections_revision=refs/tags/1.1.2
swift_corelibs_foundation_revision=refs/tags/${{ inputs.swift_tag }}
swift_corelibs_libdispatch_revision=refs/tags/${{ inputs.swift_tag }}
swift_corelibs_xctest_revision=refs/tags/${{ inputs.swift_tag }}
swift_crypto_revision=refs/tags/3.0.0
swift_driver_revision=refs/tags/${{ inputs.swift_tag }}
swift_experimental_string_processing_revision=refs/tags/${{ inputs.swift_tag }}
swift_format_revision=refs/heads/main
swift_foundation_revison=refs/heads/main
swift_foundation_icu_revision=refs/tags/0.0.8
swift_installer_scripts_revision=refs/heads/main
swift_llbuild_revision=refs/tags/${{ inputs.swift_tag }}
swift_markdown_revision=refs/tags/${{ inputs.swift_tag }}
swift_package_manager_revision=refs/tags/${{ inputs.swift_tag }}
swift_syntax_revision=refs/tags/${{ inputs.swift_tag }}
swift_system_revision=refs/tags/1.3.0
swift_tools_support_core_revision=refs/tags/${{ inputs.swift_tag }}
curl_revision=refs/tags/curl-8_5_0
ds2_revision=refs/heads/main
libxml2_revision=refs/tags/v2.11.5
yams_revision=refs/tags/5.0.6
zlib_revision=refs/tags/v1.3.1
icu_revision=refs/heads/maint/maint-69
EOF
else
repo manifest -r --suppress-upstream-revision --suppress-dest-branch | \
xmllint --xpath "//project/@name | //project/@revision" - | \
xargs -n2 | \
awk -F'[= ]' '{
split($2, repo, "/");
gsub(/-/, "_", repo[2]);
print tolower(repo[2]) "_revision=" $4
}' | tee -a "${GITHUB_OUTPUT}"
repo manifest -r --suppress-upstream-revision --suppress-dest-branch -o - | sed -E 's,[[:space:]]+$,,' > stable.xml
fi
# FIXME(z2oh): Remove /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR when GitHub runner image updates to 20240610.1.
# see: https://github.com/actions/runner-images/issues/10004
if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.debug_info }}" == "true" ]]; then
echo debug_info=true >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT}
echo CMAKE_Swift_FLAGS="-g -debug-info-format=codeview -Xlinker -debug -Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT}
else
echo debug_info=false >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo CMAKE_Swift_FLAGS="-Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT}
fi
echo ANDROID_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.signed }}" == "true" ]]; then
# FIXME(compnerd) enable this when requested
echo signed=false >> ${GITHUB_OUTPUT}
else
echo signed=false >> ${GITHUB_OUTPUT}
fi
echo swift_version=${{ inputs.swift_version || '0.0.0' }} | tee -a ${GITHUB_OUTPUT}
if [[ -n "${{ inputs.swift_tag }}" ]] ; then
echo swift_tag=${{ inputs.swift_tag }} | tee -a ${GITHUB_OUTPUT}
else
if [[ "$branch_name" == "main" ]] ; then
echo swift_tag=$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT}
else
echo swift_tag=swift-"$branch_version_string"-$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT}
fi
fi
echo windows_build_runner=${{ inputs.default_runner }} >> ${GITHUB_OUTPUT}
echo compilers_build_runner=${{ inputs.compilers_runner || inputs.default_runner }} >> ${GITHUB_OUTPUT}
echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT}
- uses: actions/upload-artifact@v4
with:
name: stable.xml
path: stable.xml
if-no-files-found: ignore
sqlite:
needs: [context]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: arm64
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: x86
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: arm64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
- arch: armv7
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
- arch: i686
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86
- arch: x86_64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64
name: ${{ matrix.os }} ${{ matrix.arch }} SQLite3
steps:
- uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/SourceCache/swift-build
show-progress: false
- name: download sqlite
run: |
curl.exe -sL "https://sqlite.org/2023/sqlite-amalgamation-3430200.zip" -o $env:TEMP\sqlite-amalgamation-3430200.zip
New-Item -ItemType Directory -Path ${{ github.workspace }}\SourceCache\sqlite-3.43.2
unzip.exe -j -o $env:TEMP\sqlite-amalgamation-3430200.zip -d ${{ github.workspace }}\SourceCache\sqlite-3.43.2
- name: Copy CMakeLists.txt
run: Copy-Item ${{ github.workspace }}\SourceCache\swift-build\cmake\SQLite\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\sqlite-3.43.2\CMakeLists.txt
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 100M
key: ${{ matrix.os }}-${{ matrix.arch }}-sqlite
variant: sccache
append-timestamp: false
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
- name: Configure SQLite
run: |
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
cmake -B ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
-D CMAKE_ANDROID_NDK=$NDKPATH `
${{ matrix.extra_flags }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/sqlite-3.43.2
- name: Build SQLite
run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-3.43.2
- name: Install SQLite
run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 --target install
- uses: actions/upload-artifact@v4
with:
name: sqlite-${{ matrix.os }}-${{ matrix.arch }}-3.43.2
path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr
# TODO(compnerd): remove this once android migrates to swift-foundation
icu_tools:
needs: [context]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
steps:
- uses: actions/checkout@v4
with:
repository: apple/swift-installer-scripts
ref: ${{ needs.context.outputs.swift_installer_scripts_revision }}
path: ${{ github.workspace }}/SourceCache/swift-installer-scripts
show-progress: false
- uses: actions/checkout@v4
with:
repository: unicode-org/icu
ref: ${{ needs.context.outputs.icu_revision }}
path: ${{ github.workspace }}/SourceCache/icu
show-progress: false
- name: Copy CMakeLists.txt
run: Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\icu\icu4c\CMakeLists.txt
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: amd64
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 100M
key: windows-amd64-icu_tools
variant: sccache
append-timestamp: false
- name: Configure ICU Build Tools
run:
cmake -B ${{ github.workspace }}/BinaryCache/icu-tools-69.1 `
-D BUILD_SHARED_LIBS=NO `
-D BUILD_TOOLS=YES `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/icu/icu4c
- name: Build ICU Tools
run: cmake --build ${{ github.workspace }}/BinaryCache/icu-tools-69.1
- uses: actions/upload-artifact@v4
with:
name: icu-tools-69.1
path: |
${{ github.workspace }}/BinaryCache/icu-tools-69.1/genbrk.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/gencfu.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/gencnval.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/gendict.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/genrb.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/gensprep.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/icupkg.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/makeconv.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/pkgdata.exe
${{ github.workspace }}/BinaryCache/icu-tools-69.1/genccode.exe
ds2_tools:
needs: [context]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
steps:
- uses: actions/checkout@v4
with:
repository: compnerd/ds2
ref: ${{ needs.context.outputs.ds2_revision }}
path: ${{ github.workspace }}/SourceCache/ds2
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: amd64
- name: Install Flex and Bison Tools
run: choco install winflexbison3
- name: Configure RegsGen2
run: |
cmake -B ${{ github.workspace }}/BinaryCache/RegsGen2 `
-S ${{ github.workspace }}/SourceCache/ds2/Tools/RegsGen2 `
-C ${{ github.workspace }}/SourceCache/ds2/cmake/caches/MSVCWarnings.cmake `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-G Ninja
- name: Build RegsGen2
run: cmake --build ${{ github.workspace }}/BinaryCache/RegsGen2 --config Release
- uses: actions/upload-artifact@v4
with:
name: windows-regsgen2
path: |
${{ github.workspace }}/BinaryCache/RegsGen2/regsgen2.exe
# TODO(compnerd): remove this once android migrates to swift-foundation
icu:
needs: [context, icu_tools]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
BUILD_TOOLS: NO
BUILD_DATA: NO
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
- arch: armv7
BUILD_TOOLS: NO
BUILD_DATA: NO
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
- arch: i686
BUILD_TOOLS: NO
BUILD_DATA: NO
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86
- arch: x86_64
BUILD_TOOLS: NO
BUILD_DATA: NO
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64
name: ${{ matrix.os }} ${{ matrix.arch }} ICU
steps:
- uses: actions/download-artifact@v4
with:
name: icu-tools-69.1
path: ${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin
- uses: actions/checkout@v4
with:
repository: apple/swift-installer-scripts
ref: ${{ needs.context.outputs.swift_installer_scripts_revision }}
path: ${{ github.workspace }}/SourceCache/swift-installer-scripts
show-progress: false
- uses: actions/checkout@v4
with:
repository: unicode-org/icu
ref: ${{ needs.context.outputs.icu_revision }}
path: ${{ github.workspace }}/SourceCache/icu
show-progress: false
- name: Copy CMakeLists.txt
run: |
Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\icu\icu4c\CMakeLists.txt
Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\icupkg.inc.cmake -destination ${{ github.workspace }}\SourceCache\icu\icu4c\icupkg.inc.cmake
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 200M
key: ${{ matrix.os }}-${{ matrix.arch }}-icu
variant: sccache
append-timestamp: false
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
- name: Configure ICU
run: |
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
cmake -B ${{ github.workspace }}/BinaryCache/icu-69.1 `
-D BUILD_SHARED_LIBS=NO `
-D BUILD_TOOLS=${{ matrix.BUILD_TOOLS }} `
-D BUILD_DATA=${{ matrix.BUILD_DATA }} `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
-D ICU_TOOLS_DIR=${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin `
-D CMAKE_ANDROID_NDK=$NDKPATH `
${{ matrix.extra_flags }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/icu/icu4c
- name: Build ICU
run: cmake --build ${{ github.workspace }}/BinaryCache/icu-69.1
- name: Install ICU
run: cmake --build ${{ github.workspace }}/BinaryCache/icu-69.1 --target install
- uses: actions/upload-artifact@v4
with:
name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1
path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr
ds2:
needs: [context, ds2_tools]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
- arch: armv7
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
- arch: i686
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86
- arch: x86_64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64
name: ${{ matrix.os }} ${{ matrix.arch }} ds2
steps:
- uses: actions/checkout@v4
with:
repository: compnerd/ds2
ref: ${{ needs.context.outputs.ds2_revision }}
path: ${{ github.workspace }}/SourceCache/ds2
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Install Flex and Bison Tools
run: choco install winflexbison3
- uses: actions/download-artifact@v4
with:
name: windows-regsgen2
path: ${{ github.workspace }}/BinaryCache/RegsGen2
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
- name: Configure DS2
run: |
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
cmake -B ${{ github.workspace }}/BinaryCache/ds2 `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/DebugServer2 `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D DS2_REGSGEN2=${{ github.workspace }}/BinaryCache/RegsGen2/regsgen2.exe `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
-D CMAKE_ANDROID_NDK=$NDKPATH `
${{ matrix.extra_flags }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/ds2
- name: Build DS2
run: cmake --build ${{ github.workspace }}/BinaryCache/ds2
- name: Install DS2
run: cmake --build ${{ github.workspace }}/BinaryCache/ds2 --target install
- uses: actions/upload-artifact@v4
with:
name: ds2-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/DebugServer2/bin/ds2
cmark_gfm:
needs: [context]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
arch: ['amd64', 'arm64']
steps:
- uses: actions/checkout@v4
with:
repository: apple/swift-cmark
ref: ${{ needs.context.outputs.swift_cmark_revision }}
path: ${{ github.workspace }}/SourceCache/cmark-gfm
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 1M
key: windows-${{ matrix.arch }}-cmark-gfm
variant: sccache
append-timestamp: false
- name: Configure cmark-gfm
run: >
cmake -B ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_COMPILER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr `
-D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=YES `
-S ${{ github.workspace }}/SourceCache/cmark-gfm `
-G Ninja
- name: Build cmark-gfm
run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13
- name: Install cmark-gfm
run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 --target install
- uses: actions/upload-artifact@v4
with:
name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
build_tools:
needs: [context, cmark_gfm]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
steps:
- uses: actions/download-artifact@v4
with:
name: cmark-gfm-amd64-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
- uses: actions/checkout@v4
with:
repository: apple/llvm-project
ref: ${{ needs.context.outputs.llvm_project_revision }}
path: ${{ github.workspace }}/SourceCache/llvm-project
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift
ref: ${{ needs.context.outputs.swift_revision }}
path: ${{ github.workspace }}/SourceCache/swift
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 100M
key: windows-amd64-build_tools
variant: sccache
append-timestamp: false
- name: Configure Tools
run: |
cmake -B ${{ github.workspace }}/BinaryCache/0 `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/llvm-project/llvm `
-D LLVM_ENABLE_ASSERTIONS=NO `
-D LLVM_ENABLE_LIBEDIT=NO `
-D LLVM_ENABLE_LIBXML2=NO `
-D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lldb" `
-D LLVM_EXTERNAL_PROJECTS="swift" `
-D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=${{ github.workspace }}/SourceCache/swift `
-D LLDB_ENABLE_PYTHON=NO `
-D LLDB_INCLUDE_TESTS=NO `
-D LLDB_ENABLE_SWIFT_SUPPORT=NO `
-D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=NO `
-D SWIFT_BUILD_DYNAMIC_STDLIB=NO `
-D SWIFT_BUILD_HOST_DISPATCH=NO `
-D SWIFT_BUILD_LIBEXEC=NO `
-D SWIFT_BUILD_REGEX_PARSER_IN_COMPILER=NO `
-D SWIFT_BUILD_REMOTE_MIRROR=NO `
-D SWIFT_BUILD_SOURCEKIT=NO `
-D SWIFT_BUILD_STATIC_SDK_OVERLAY=NO `
-D SWIFT_BUILD_STATIC_STDLIB=NO `
-D SWIFT_BUILD_SWIFT_SYNTAX=NO `
-D SWIFT_ENABLE_DISPATCH=NO `
-D SWIFT_INCLUDE_APINOTES=NO `
-D SWIFT_INCLUDE_DOCS=NO `
-D SWIFT_INCLUDE_TESTS=NO
- name: Build llvm-tblgen
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target llvm-tblgen
- name: Build clang-tblgen
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-tblgen
- name: Build lldb-tblgen
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target lldb-tblgen
- name: Build llvm-config
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target llvm-config
- name: Build clang-pseudo-gen
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-pseudo-gen
- name: Build clang-tidy-confusable-chars-gen
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-tidy-confusable-chars-gen
- name: Build swift-def-to-strings-converter
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-def-to-strings-converter
- name: Build swift-serialize-diagnostics
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-serialize-diagnostics
- name: Build swift-compatibility-symbols
run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-compatibility-symbols
- uses: actions/upload-artifact@v4
with:
name: build-tools
path: |
${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen.exe
${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen.exe
${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen.exe
${{ github.workspace }}/BinaryCache/0/bin/llvm-config.exe
${{ github.workspace }}/BinaryCache/0/bin/clang-pseudo-gen.exe
${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe
${{ github.workspace }}/BinaryCache/0/bin/swift-def-to-strings-converter.exe
${{ github.workspace }}/BinaryCache/0/bin/swift-serialize-diagnostics.exe
${{ github.workspace }}/BinaryCache/0/bin/swift-compatibility-symbols.exe
compilers:
needs: [context, build_tools, cmark_gfm]
runs-on: ${{ needs.context.outputs.compilers_build_runner }}
env:
# Must be a full version string from https://www.nuget.org/packages/pythonarm64
PYTHON_VERSION: 3.9.10
strategy:
fail-fast: false
matrix:
include:
- arch: 'amd64'
cpu: 'x86_64'
triple: 'x86_64-unknown-windows-msvc'
- arch: 'arm64'
cpu: 'aarch64'
triple: 'aarch64-unknown-windows-msvc'
steps:
- uses: actions/download-artifact@v4
with:
name: build-tools
path: ${{ github.workspace }}/BinaryCache/0/bin
- uses: actions/download-artifact@v4
with:
name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
- uses: actions/checkout@v4
with:
repository: apple/llvm-project
ref: ${{ needs.context.outputs.llvm_project_revision }}
path: ${{ github.workspace }}/SourceCache/llvm-project
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift
ref: ${{ needs.context.outputs.swift_revision }}
path: ${{ github.workspace }}/SourceCache/swift
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-experimental-string-processing
ref: ${{ needs.context.outputs.swift_experimental_string_processing_revision }}
path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-syntax
ref: ${{ needs.context.outputs.swift_syntax_revision }}
path: ${{ github.workspace }}/SourceCache/swift-syntax
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-corelibs-libdispatch
ref: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }}
path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch
show-progress: false
- name: Install Python ${{ env.PYTHON_VERSION }} (Host)
uses: actions/setup-python@v5
id: python
with:
python-version: '${{ env.PYTHON_VERSION }}'
- uses: nuget/setup-nuget@v2
if: matrix.arch == 'arm64'
# TODO(lxbndr) use actions/cache to improve this step timings
- name: Install Python ${{ env.PYTHON_VERSION }} (arm64)
if: matrix.arch == 'arm64'
run: |
$NugetSources=[string](nuget Sources List -Format short)
if (-Not ($NugetSources.contains("api.nuget.org"))) {
nuget sources Add -Name api.nuget.org -Source https://api.nuget.org/v3/index.json -NonInteractive
}
nuget install pythonarm64 -Version ${{ env.PYTHON_VERSION }}
- name: Export Python Location
run: |
echo "PYTHON_LOCATION_amd64=$env:pythonLocation" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PYTHON_LOCATION_arm64=${{ github.workspace }}\pythonarm64.${{ env.PYTHON_VERSION }}\tools" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Install Swift Toolchain
uses: compnerd/gha-setup-swift@main
with:
github-repo: thebrowsercompany/swift-build
github-token: ${{ secrets.GITHUB_TOKEN }}
release-asset-name: installer-amd64.exe
release-tag-name: '20231016.0'
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 500M
key: windows-${{ matrix.arch }}-compilers
variant: sccache
append-timestamp: false
- name: Configure Compilers
env:
NDKPATH: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
if ( "${{ matrix.arch }}" -eq "arm64" ) {
$CMAKE_SYSTEM_NAME="-D CMAKE_SYSTEM_NAME=Windows"
$CMAKE_SYSTEM_PROCESSOR="-D CMAKE_SYSTEM_PROCESSOR=ARM64"
$CACHE="Windows-aarch64.cmake"
# FIXME(compnerd) re-enable runtimes after we sort out compiler-rt
(Get-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake).Replace(' runtimes', '') | Set-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake
} else {
$CACHE="Windows-x86_64.cmake"
}
$SWIFTC = cygpath -m (Get-Command swiftc).Source
$SDKROOT = cygpath -m ${env:SDKROOT}
# Use toolchain clang to avoid broken __prefetch intrinsic on arm64 in Clang 18.
$CLANG_LOCATION = cygpath -m (Split-Path (Get-Command swiftc).Source)
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/1 `
-C ${{ github.workspace }}/SourceCache/swift/cmake/caches/${CACHE} `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" `
-D CMAKE_MT=mt `
-D CMAKE_Swift_COMPILER="${SWIFTC}" `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk `"${SDKROOT}`" -Xcc -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" `
-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" `
${CMAKE_SYSTEM_NAME} `
${CMAKE_SYSTEM_PROCESSOR} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/llvm-project/llvm `
-D CLANG_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen.exe `
-D CLANG_TIDY_CONFUSABLE_CHARS_GEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe `
-D LLDB_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen.exe `
-D LLVM_CONFIG_PATH=${{ github.workspace }}/BinaryCache/0/bin/llvm-config.exe `
-D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=${{ github.workspace }}/SourceCache/swift `
-D LLVM_NATIVE_TOOL_DIR=${{ github.workspace }}/BinaryCache/0/bin `
-D LLVM_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen.exe `
-D LLVM_USE_HOST_TOOLS=NO `
-D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=NO `
-D SWIFT_BUILD_DYNAMIC_STDLIB=NO `
-D SWIFT_BUILD_REMOTE_MIRROR=NO `
-D SWIFT_BUILD_SWIFT_SYNTAX=YES `
-D SWIFT_CLANG_LOCATION=${CLANG_LOCATION} `
-D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES `
-D SWIFT_ENABLE_SYNCHRONIZATION=YES `
-D SWIFT_NATIVE_SWIFT_TOOLS_PATH=${{ github.workspace }}/BinaryCache/0/bin `
-D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch `
-D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ github.workspace }}/SourceCache/swift-syntax `
-D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ github.workspace }}/SourceCache/swift-experimental-string-processing `
-D SWIFT_PATH_TO_SWIFT_SDK="${SDKROOT}" `
-D CLANG_VENDOR=compnerd.org `
-D CLANG_VENDOR_UTI=org.compnerd.dt `
-D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake `
-D PACKAGE_VENDOR=compnerd.org `
-D SWIFT_VENDOR=compnerd.org `
-D LLVM_PARALLEL_LINK_JOBS=8 `
-D SWIFT_PARALLEL_LINK_JOBS=8 `
-D LLVM_APPEND_VC_REV=NO `
-D LLVM_VERSION_SUFFIX="" `
-D LLDB_PYTHON_EXE_RELATIVE_PATH=python.exe `
-D LLDB_PYTHON_EXT_SUFFIX=.pyd `
-D LLDB_PYTHON_RELATIVE_PATH=lib/site-packages `
-D Python3_EXECUTABLE=${{ steps.python.outputs.python-path }} `
-D Python3_INCLUDE_DIR=$env:PYTHON_LOCATION_${{ matrix.arch }}\include `
-D Python3_LIBRARY=$env:PYTHON_LOCATION_${{ matrix.arch }}\libs\python39.lib `
-D Python3_ROOT_DIR=$env:pythonLocation
- name: Build Compiler Distribution
run: cmake --build ${{ github.workspace }}/BinaryCache/1 --target distribution
- name: Install Compiler Distribution
run: cmake --build ${{ github.workspace }}/BinaryCache/1 --target install-distribution-stripped
- name: Upload Compilers
uses: actions/upload-artifact@v4
with:
name: compilers-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library
- name: extract swift-syntax
run: |
$module = "${{ github.workspace }}/BinaryCache/1/cmake/modules/SwiftSyntaxConfig.cmake"
$bindir = cygpath -m ${{ github.workspace }}/BinaryCache/1
(Get-Content $module).Replace("${bindir}", '<BINARY_DIR>') | Set-Content $module
New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host -ItemType Directory | Out-Null
Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib"
Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host"
Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/swift/host/*.swiftmodule" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host" -Recurse
New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules -ItemType Directory | Out-Null
Copy-Item -Path $module -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules"
- name: Upload swift-syntax
uses: actions/upload-artifact@v4
with:
name: swift-syntax-${{ matrix.arch }}
path: ${{ github.workspace }}/BinaryCache/swift-syntax
# TODO(compnerd) this takes ~1h due to the size, see if we can compress first
- uses: actions/upload-artifact@v4
if: false # ${{ needs.context.outputs.debug_info }}
with:
name: compilers-${{ matrix.arch }}-debug-info
path: |
${{ github.workspace }}/BinaryCache/1/**/*.pdb
- name: Upload PDBs to Azure
uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache/1
searchPattern: '**/*.pdb'
- name: Upload DLLs to Azure
uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache/1
searchPattern: '**/*.dll'
- name: Upload EXEs to Azure
uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache/1
searchPattern: '**/*.exe'
zlib:
needs: [context]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: arm64
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: x86
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: arm64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
- arch: armv7
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
- arch: i686
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86
- arch: x86_64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64
name: ${{ matrix.os }} ${{ matrix.arch }} zlib
steps:
- uses: actions/checkout@v4
with:
repository: madler/zlib
ref: ${{ needs.context.outputs.zlib_revision }}
path: ${{ github.workspace }}/SourceCache/zlib
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 100M
key: ${{ matrix.os }}-${{ matrix.arch }}-zlib
variant: sccache
append-timestamp: false
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
- name: Configure zlib
run: |
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
cmake -B ${{ github.workspace }}/BinaryCache/zlib-1.3 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
-D CMAKE_ANDROID_NDK=$NDKPATH `
-D CMAKE_POSITION_INDEPENDENT_CODE=YES `
${{ matrix.extra_flags }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/zlib `
-D SKIP_INSTALL_FILES=YES
- name: Build zlib
run: cmake --build ${{ github.workspace }}/BinaryCache/zlib-1.3
- name: Install zlib
run: cmake --build ${{ github.workspace }}/BinaryCache/zlib-1.3 --target install
- uses: actions/upload-artifact@v4
with:
name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3
path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr
curl:
needs: [context, zlib]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: arm64
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: x86
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: arm64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
- arch: armv7
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
- arch: i686
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86
- arch: x86_64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64
name: ${{ matrix.os }} ${{ matrix.arch }} curl
steps:
- uses: actions/checkout@v4
with:
repository: curl/curl
ref: ${{ needs.context.outputs.curl_revision }}
path: ${{ github.workspace }}/SourceCache/curl
show-progress: false
- uses: actions/download-artifact@v4
with:
name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3
path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 100M
key: ${{ matrix.os }}-${{ matrix.arch }}-curl
variant: sccache
append-timestamp: false
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
- name: Configure curl
run: |
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
cmake -B ${{ github.workspace }}/BinaryCache/curl-7.77.0 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
${{ matrix.extra_flags }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/curl `
-D BUILD_TESTING=NO `
-D BUILD_CURL_EXE=NO `
-D CURL_CA_BUNDLE="none" `
-D CURL_CA_FALLBACK=NO `
-D CURL_CA_PATH="none" `
-D CURL_BROTLI=NO `
-D CURL_DISABLE_ALTSVC=NO `
-D CURL_DISABLE_AWS=YES `
-D CURL_DISABLE_BASIC_AUTH=NO `
-D CURL_DISABLE_BEARER_AUTH=NO `
-D CURL_DISABLE_COOKIES=NO `
-D CURL_DISABLE_DICT=YES `
-D CURL_DISABLE_DIGEST_AUTH=NO `
-D CURL_DISABLE_DOH=NO `
-D CURL_DISABLE_FILE=YES `
-D CURL_DISABLE_FORM_API=NO `
-D CURL_DISABLE_FTP=YES `
-D CURL_DISABLE_GETOPTIONS=NO `
-D CURL_DISABLE_GOPHER=YES `
-D CURL_DISABLE_HSTS=NO `
-D CURL_DISABLE_HTTP=NO `
-D CURL_DISABLE_HTTP_AUTH=NO `
-D CURL_DISABLE_IMAP=YES `
-D CURL_DISABLE_KERBEROS_AUTH=NO `
-D CURL_DISABLE_LDAP=YES `
-D CURL_DISABLE_LDAPS=YES `
-D CURL_DISABLE_MIME=NO `
-D CURL_DISABLE_MQTT=YES `
-D CURL_DISABLE_NEGOTIATE_AUTH=NO `
-D CURL_DISABLE_NETRC=NO `
-D CURL_DISABLE_NTLM=NO `
-D CURL_DISABLE_PARSEDATE=NO `
-D CURL_DISABLE_POP3=YES `
-D CURL_DISABLE_PROGRESS_METER=YES `
-D CURL_DISABLE_PROXY=NO `
-D CURL_DISABLE_RTSP=YES `
-D CURL_DISABLE_SHUFFLE_DNS=YES `
-D CURL_DISABLE_SMB=YES `
-D CURL_DISABLE_SMTP=YES `
-D CURL_DISABLE_SOCKETPAIR=YES `
-D CURL_DISABLE_SRP=NO `
-D CURL_DISABLE_TELNET=YES `
-D CURL_DISABLE_TFTP=YES `
-D CURL_DISABLE_VERBOSE_STRINGS=NO `
-D CURL_LTO=NO `
-D CURL_USE_BEARSSL=NO `
-D CURL_USE_GNUTLS=NO `
-D CURL_USE_GSSAPI=NO `
-D CURL_USE_LIBPSL=NO `
-D CURL_USE_LIBSSH=NO `
-D CURL_USE_LIBSSH2=NO `
-D CURL_USE_MBEDTLS=NO `
-D CURL_USE_OPENSSL=NO `
-D CURL_USE_SCHANNEL=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} `
-D CURL_USE_WOLFSSL=NO `
-D CURL_WINDOWS_SSPI=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} `
-D CURL_ZLIB=YES `
-D CURL_ZSTD=NO `
-D ENABLE_ARES=NO `
-D ENABLE_CURLDEBUG=NO `
-D ENABLE_DEBUG=NO `
-D ENABLE_IPV6=YES `
-D ENABLE_MANUAL=NO `
-D ENABLE_THREADED_RESOLVER=NO `
-D ENABLE_UNICODE=YES `
-D ENABLE_UNIX_SOCKETS=NO `
-D ENABLE_WEBSOCKETS=NO `
-D HAVE_POLL_FINE=NO `
-D USE_IDN2=NO `
-D USE_MSH3=NO `
-D USE_NGHTTP2=NO `
-D USE_NGTCP2=NO `
-D USE_QUICHE=NO `
-D USE_WIN32_IDN=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} `
-D USE_WIN32_LARGE_FILES=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} `
-D USE_WIN32_LDAP=NO `
-D ZLIB_ROOT=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr `
-D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/zlibstatic.lib `
-D CMAKE_POSITION_INDEPENDENT_CODE=YES `
-D CMAKE_ANDROID_NDK=$NDKPATH
- name: Build curl
run: cmake --build ${{ github.workspace }}/BinaryCache/curl-7.77.0
- name: Install curl
run: cmake --build ${{ github.workspace }}/BinaryCache/curl-7.77.0 --target install
- uses: actions/upload-artifact@v4
with:
name: curl-${{ matrix.os }}-${{ matrix.arch }}-7.77.0
path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr
libxml2:
needs: [context]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: arm64
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: x86
cc: cl
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: cl
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
os: Windows
extra_flags:
- arch: arm64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
- arch: armv7
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
- arch: i686
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86
- arch: x86_64
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
os: Android
extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64
name: ${{ matrix.os }} ${{ matrix.arch }} libxml2
steps:
- uses: actions/checkout@v4
with:
repository: gnome/libxml2
ref: ${{ needs.context.outputs.libxml2_revision }}
path: ${{ github.workspace }}/SourceCache/libxml2
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Setup sccache
uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
with:
max-size: 100M
key: ${{ matrix.os }}-${{ matrix.arch }}-libxml2
variant: sccache
append-timestamp: false
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
- name: Configure libxml2
run: |
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
cmake -B ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
${{ matrix.extra_flags }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/libxml2 `
-D LIBXML2_WITH_ICONV=NO `
-D LIBXML2_WITH_ICU=NO `
-D LIBXML2_WITH_LZMA=NO `
-D LIBXML2_WITH_PYTHON=NO `
-D LIBXML2_WITH_TESTS=NO `
-D LIBXML2_WITH_THREADS=YES `
-D LIBXML2_WITH_ZLIB=NO `
-D CMAKE_POSITION_INDEPENDENT_CODE=YES `
-D CMAKE_ANDROID_NDK=$NDKPATH
- name: Build libxml2
run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5
- name: Install libxml2
run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 --target install
- uses: actions/upload-artifact@v4
with:
name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5
path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr
sdk:
continue-on-error: ${{ matrix.arch != 'amd64' }}
needs: [context, icu, ds2, libxml2, curl, zlib, compilers, cmark_gfm]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
cpu: 'x86_64'
triple: 'x86_64-unknown-windows-msvc'
triple_no_api_level: 'x86_64-unknown-windows-msvc'
cc: '$CLANG_CL'
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: '$CLANG_CL'
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}
os: Windows
llvm_flags:
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"'
extra_flags:
- arch: arm64
cpu: 'aarch64'
triple: 'aarch64-unknown-windows-msvc'
triple_no_api_level: 'aarch64-unknown-windows-msvc'
cc: '$CLANG_CL'
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: '$CLANG_CL'
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}
os: Windows
llvm_flags:
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"'
extra_flags:
- arch: x86
cpu: 'i686'
triple: 'i686-unknown-windows-msvc'
triple_no_api_level: 'i686-unknown-windows-msvc'
cc: '$CLANG_CL'
cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
cxx: '$CLANG_CL'
cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}
os: Windows
llvm_flags:
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"'
extra_flags:
- arch: arm64
cpu: 'aarch64'
triple: 'aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}'
triple_no_api_level: aarch64-unknown-linux-android
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g
os: Android
llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"'
extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
- arch: armv7
cpu: armv7
triple: 'armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }}'
triple_no_api_level: armv7-unknown-linux-androideabi
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g
os: Android
llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=armv7-a -DLLVM_HOST_TRIPLE=armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }}
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"'
extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
- arch: i686
cpu: i686
triple: 'i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}'
triple_no_api_level: i686-unknown-linux-android
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g
os: Android
llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=i686 -DLLVM_HOST_TRIPLE=i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"'
extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86
- arch: x86_64
cpu: 'x86_64'
triple: 'x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}'
triple_no_api_level: x86_64-unknown-linux-android
cc: clang
cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
cxx: clang++
cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g
os: Android
llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"'
extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64
name: ${{ matrix.os }} ${{ matrix.arch }} SDK
steps:
- uses: actions/download-artifact@v4
if: matrix.os == 'Android'
with:
name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1
path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr
- uses: actions/download-artifact@v4
with:
name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5
path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr
- uses: actions/download-artifact@v4
with:
name: curl-${{ matrix.os }}-${{ matrix.arch }}-7.77.0
path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr
- uses: actions/download-artifact@v4
with:
name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3
path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr
- uses: actions/download-artifact@v4
if: matrix.os == 'Android'
with:
name: ds2-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/DebugServer2/bin/ds2
- name: Download Compilers
uses: actions/download-artifact@v4
with:
name: compilers-amd64
path: ${{ github.workspace }}/BuildRoot/Library
- uses: actions/download-artifact@v4
with:
name: cmark-gfm-amd64-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
- name: cmark-gfm Setup
run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/
- uses: actions/checkout@v4
with:
repository: apple/llvm-project
ref: ${{ needs.context.outputs.llvm_project_revision }}
path: ${{ github.workspace }}/SourceCache/llvm-project
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift
ref: ${{ needs.context.outputs.swift_revision }}
path: ${{ github.workspace }}/SourceCache/swift
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-syntax
ref: ${{ needs.context.outputs.swift_syntax_revision }}
path: ${{ github.workspace }}/SourceCache/swift-syntax
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-corelibs-libdispatch
ref: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }}
path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch
show-progress: false
- uses: actions/checkout@v4
if: matrix.os == 'Windows'
with:
repository: apple/swift-corelibs-foundation
ref: ${{ needs.context.outputs.swift_corelibs_foundation_revision }}
path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation
show-progress: false
- uses: actions/checkout@v4
if: matrix.os == 'Windows'
with:
repository: apple/swift-foundation
ref: ${{ needs.context.outputs.swift_foundation_revision }}
path: ${{ github.workspace }}/SourceCache/swift-foundation
show-progress: false
- uses: actions/checkout@v4
if: matrix.os == 'Windows'
with:
repository: apple/swift-foundation-icu
ref: ${{ needs.context.outputs.swift_foundation_icu_revision }}
path: ${{ github.workspace }}/SourceCache/swift-foundation-icu
show-progress: false
- uses: actions/checkout@v4
if: matrix.os == 'Windows'
with:
repository: apple/swift-collections
ref: ${{ needs.context.outputs.swift_collections_revision }}
path: ${{ github.workspace }}/SourceCache/swift-collections
show-progress: false
- uses: actions/checkout@v4
if: matrix.os == 'Android'
with:
repository: apple/swift-corelibs-foundation
ref: a515f3e15c81d029411c540df7edf52d427ff2cb
path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-corelibs-xctest
ref: ${{ needs.context.outputs.swift_corelibs_xctest_revision }}
path: ${{ github.workspace }}/SourceCache/swift-corelibs-xctest
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-experimental-string-processing
ref: ${{ needs.context.outputs.swift_experimental_string_processing_revision }}
path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing
show-progress: false
# NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- name: Install Swift Toolchain
uses: compnerd/gha-setup-swift@main
with:
github-repo: thebrowsercompany/swift-build
github-token: ${{ secrets.GITHUB_TOKEN }}
release-asset-name: installer-amd64.exe
release-tag-name: '20231016.0'
# FIXME(compnerd): workaround CMake 3.30 issue
- uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.29'
# NOTE(compnerd): we execute unconditionally as we reference outputs
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b
- name: Configure LLVM
run: |
$CLANG_CL = "cl"
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/llvm `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
${{ matrix.llvm_flags }} `
${{ matrix.extra_flags }} `
-D CMAKE_ANDROID_NDK=$NDKPATH `
-D SWIFT_ANDROID_NDK_PATH=$NDKPATH `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/llvm-project/llvm `
-D LLVM_ENABLE_ASSERTIONS=YES
- name: Configure Swift Standard Library
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/swift `
-C ${{ github.workspace }}/SourceCache/swift/cmake/caches/Runtime-${{ matrix.os }}-${{ matrix.cpu }}.cmake `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
-D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/swift/lib/swift ${{ matrix.swiftflags }}" `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} `
${{ matrix.linker_flags }} `
${{ matrix.extra_flags }} `
-D CMAKE_ANDROID_NDK=$NDKPATH `
-D SWIFT_ANDROID_NDK_PATH=$NDKPATH `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift `
-D LLVM_DIR=${{ github.workspace }}/BinaryCache/llvm/lib/cmake/llvm `
-D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=YES `
-D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES `
-D SWIFT_ENABLE_SYNCHRONIZATION=YES `
-D SWIFT_ENABLE_VOLATILE=YES `
-D SWIFT_NATIVE_SWIFT_TOOLS_PATH=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin `
-D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch `
-D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ github.workspace }}/SourceCache/swift-syntax `
-D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ github.workspace }}/SourceCache/swift-experimental-string-processing
- name: Build Swift Standard Library
run: |
Remove-Item env:\SDKROOT
cmake --build ${{ github.workspace }}/BinaryCache/swift
- name: Install Swift Standard Library
run: |
Remove-Item env:\SDKROOT
cmake --build ${{ github.workspace }}/BinaryCache/swift --target install
- name: Configure libdispatch
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
$WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" }
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/libdispatch `
-D BUILD_SHARED_LIBS=YES `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
-D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} `
${{ matrix.linker_flags }} `
${{ matrix.extra_flags }} `
-D CMAKE_ANDROID_NDK=$NDKPATH `
-D SWIFT_ANDROID_NDK_PATH=$NDKPATH `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch `
-D BUILD_TESTING=NO `
-D ENABLE_SWIFT=YES
- name: Build libdispatch
run: |
Remove-Item env:\SDKROOT
cmake --build ${{ github.workspace }}/BinaryCache/libdispatch
- name: Configure Foundation
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
$WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" }
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
$DEFINITION_FLAG = if ("${{ matrix.os }}" -eq "Windows") { "/D" } else { "-D" }
$zlib_lib = if ("${{ matrix.os }}" -eq "Windows") { "zlibstatic.lib" } else { "libz.a" }
$xml_lib = if ("${{ matrix.os }}" -eq "Windows") { "libxml2s.lib" } else { "libxml2.a" }
$SWIFT_FOUNDATION_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-foundation
$SWIFT_FOUNDATION_ICU_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-foundation-icu
$SWIFT_COLLECTIONS_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-collections
$ICU_FLAGS = if ("${{ matrix.os }}" -eq "Android") {
"-D","ICU_DATA_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicudt69.a",
"-D","ICU_I18N_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicuin69.a",
"-D","ICU_ROOT=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr",
"-D","ICU_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/include",
"-D","ICU_UC_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicuuc69.a"
} else {
@()
}
$build_tools = if ("${{ matrix.os }}" -eq "Windows") { "YES" } else { "NO" }
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/foundation `
-D BUILD_SHARED_LIBS=YES `
-D CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL="/MD" `
-D CMAKE_ASM_FLAGS="--target=${{ matrix.triple }}" `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
-D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} `
${{ matrix.linker_flags }} `
${{ matrix.extra_flags }} `
-D CMAKE_ANDROID_NDK=$NDKPATH `
-D SWIFT_ANDROID_NDK_PATH=$NDKPATH `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-corelibs-foundation `
-D dispatch_DIR=${{ github.workspace }}/BinaryCache/libdispatch/cmake/modules `
-D CURL_DIR=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr/lib/cmake/CURL `
-D FOUNDATION_BUILD_TOOLS=${build_tools} `
-D ENABLE_TESTING=NO `
@ICU_FLAGS `
-D _SwiftFoundation_SourceDIR=$SWIFT_FOUNDATION_SOURCE_DIR `
-D _SwiftFoundationICU_SourceDIR=$SWIFT_FOUNDATION_ICU_SOURCE_DIR `
-D _SwiftCollections_SourceDIR=$SWIFT_COLLECTIONS_SOURCE_DIR `
-D LIBXML2_DEFINITIONS="${DEFINITION_FLAG}LIBXML_STATIC" `
-D LIBXML2_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/include/libxml2 `
-D LIBXML2_LIBRARY=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/lib/$xml_lib `
-D ZLIB_ROOT=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr `
-D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/$zlib_lib
- name: Build foundation
run: |
Remove-Item env:\SDKROOT
cmake --build ${{ github.workspace }}/BinaryCache/foundation
# TODO(compnerd) correctly version XCTest
- name: Configure xctest
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
$WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml
$OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" }
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/xctest `
-D BUILD_SHARED_LIBS=YES `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_BUILD_WITH_INSTALL_RPATH=YES `
-D CMAKE_C_COMPILER=${{ matrix.cc }} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
-D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} `
${{ matrix.linker_flags }} `
${{ matrix.extra_flags }} `
-D CMAKE_ANDROID_NDK=$NDKPATH `
-D SWIFT_ANDROID_NDK_PATH=$NDKPATH `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-corelibs-xctest `
-D dispatch_DIR=${{ github.workspace }}/BinaryCache/libdispatch/cmake/modules `
-D Foundation_DIR=${{ github.workspace }}/BinaryCache/foundation/cmake/modules `
-D ENABLE_TESTING=NO
- name: Build xctest
run: |
Remove-Item env:\SDKROOT
cmake --build ${{ github.workspace }}/BinaryCache/xctest
- name: Install xctest
run: |
Remove-Item env:\SDKROOT
cmake --build ${{ github.workspace }}/BinaryCache/xctest --target install
- name: Install foundation
run: |
Remove-Item env:\SDKROOT
cmake --build ${{ github.workspace }}/BinaryCache/foundation --target install
- name: Install libdispatch
run: |
Remove-Item env:\SDKROOT
cmake --build ${{ github.workspace }}/BinaryCache/libdispatch --target install
- uses: actions/setup-python@v5
- uses: jannekem/run-python-script-action@v1
with:
script: |
import os
import plistlib
info_plist = r'${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Info.plist'
with open(os.path.normpath(info_plist), 'wb') as plist:
# TODO(compnerd) derive this from the install directory
plistlib.dump({ 'DefaultProperties': { 'XCTEST_VERSION': 'development', 'SWIFTC_FLAGS': ['-use-ld=lld'] } }, plist)
sdk_settings_plist = r'${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/SDKSettings.plist'
with open(os.path.normpath(sdk_settings_plist), 'wb') as plist:
# TODO(compnerd) derive this from the CMAKE_BUILD_TYPE for the
# runtime.
plistlib.dump({ 'DefaultProperties': { 'DEFAULT_USE_RUNTIME': 'MD' } }, plist)
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-sdk-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform
- name: Upload PDBs to Azure
uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info && matrix.os == 'Windows' }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache
searchPattern: '**/*.pdb'
- name: Upload DLLs to Azure
uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info && matrix.os == 'Windows' }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache
searchPattern: '**/*.dll'
devtools:
needs: [context, sqlite, compilers, sdk]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: 'amd64'
cpu: 'x86_64'
triple: 'x86_64-unknown-windows-msvc'
- arch: 'arm64'
cpu: 'aarch64'
triple: 'aarch64-unknown-windows-msvc'
steps:
- uses: actions/download-artifact@v4
with:
name: sqlite-Windows-${{ matrix.arch }}-3.43.2
path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr
- name: Download Compilers
uses: actions/download-artifact@v4
with:
name: compilers-amd64
path: ${{ github.workspace }}/BuildRoot/Library
- uses: actions/download-artifact@v4
with:
name: Windows-sdk-amd64
path: ${{ github.workspace }}/BinaryCache
- name: Download SDK
uses: actions/download-artifact@v4
with:
name: Windows-sdk-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
- name: Downlaod swift-syntax
uses: actions/download-artifact@v4
with:
name: swift-syntax-${{ matrix.arch }}
path: ${{ github.workspace }}/BinaryCache/swift-syntax
- uses: actions/download-artifact@v4
with:
name: cmark-gfm-amd64-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
- name: cmark-gfm Setup
run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/
- uses: actions/download-artifact@v4
if: matrix.arch == 'arm64'
with:
name: cmark-gfm-arm64-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
- uses: actions/checkout@v4
with:
repository: apple/indexstore-db
ref: ${{ needs.context.outputs.indexstore_db_revision }}
path: ${{ github.workspace }}/SourceCache/indexstore-db
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/sourcekit-lsp
ref: ${{ needs.context.outputs.sourcekit_lsp_revision }}
path: ${{ github.workspace }}/SourceCache/sourcekit-lsp
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-argument-parser
ref: ${{ needs.context.outputs.swift_argument_parser_revision }}
path: ${{ github.workspace }}/SourceCache/swift-argument-parser
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-asn1
ref: ${{ needs.context.outputs.swift_asn1_revision }}
path: ${{ github.workspace }}/SourceCache/swift-asn1
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-certificates
ref: ${{ needs.context.outputs.swift_certificates_revision }}
path: ${{ github.workspace }}/SourceCache/swift-certificates
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-collections
ref: ${{ needs.context.outputs.swift_collections_revision }}
path: ${{ github.workspace }}/SourceCache/swift-collections
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-crypto
ref: ${{ needs.context.outputs.swift_crypto_revision }}
path: ${{ github.workspace }}/SourceCache/swift-crypto
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-driver
ref: ${{ needs.context.outputs.swift_driver_revision }}
path: ${{ github.workspace }}/SourceCache/swift-driver
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-format
ref: ${{ needs.context.outputs.swift_format_revision }}
path: ${{ github.workspace }}/SourceCache/swift-format
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-llbuild
ref: ${{ needs.context.outputs.swift_llbuild_revision }}
path: ${{ github.workspace }}/SourceCache/swift-llbuild
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-markdown
ref: ${{ needs.context.outputs.swift_markdown_revision }}
path: ${{ github.workspace }}/SourceCache/swift-markdown
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-package-manager
ref: ${{ needs.context.outputs.swift_package_manager_revision }}
path: ${{ github.workspace }}/SourceCache/swift-package-manager
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-system
ref: ${{ needs.context.outputs.swift_system_revision }}
path: ${{ github.workspace }}/SourceCache/swift-system
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift-tools-support-core
ref: ${{ needs.context.outputs.swift_tools_support_core_revision }}
path: ${{ github.workspace }}/SourceCache/swift-tools-support-core
show-progress: false
- uses: actions/checkout@v4
with:
repository: jpsim/Yams
ref: ${{ needs.context.outputs.yams_revision }}
path: ${{ github.workspace }}/SourceCache/Yams
show-progress: false
- uses: actions/checkout@v4
with:
repository: apple/swift
ref: ${{ needs.context.outputs.swift_revision }}
path: ${{ github.workspace }}/SourceCache/swift
show-progress: false
- run: |
$RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin
echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- run: |
$env:SDKROOT="${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk"
Move-Item ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/
Move-Item ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/
Move-Item ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/
Move-Item ${env:SDKROOT}/usr/lib/swift/_foundation_unicode ${env:SDKROOT}/usr/include
Move-Item ${env:SDKROOT}/usr/lib/swift/_FoundationCShims ${env:SDKROOT}/usr/include
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/_FoundationICU.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
- name: Configure swift-argument-parser
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-argument-parser `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-argument-parser
- name: Build swift-argument-parser
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-argument-parser
- name: Configure swift-collections
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-collections `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-collections
- name: Build swift-collections
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-collections
- name: Configure swift-crypto
run: |
# Workaround CMake 3.20 issue
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-crypto `
-D BUILD_SHARED_LIBS=NO `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-crypto
- name: Build swift-crypto
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-crypto
- name: Configure Yams
run: |
# Workaround CMake 3.20 issue
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/yams `
-D BUILD_SHARED_LIBS=NO `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/Yams
- name: Build Yams
run: cmake --build ${{ github.workspace }}/BinaryCache/yams
- name: Configure swift-llbuild
run: |
# Workaround CMake 3.20 issue
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-llbuild `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-llbuild `
-D LLBUILD_SUPPORT_BINDINGS=Swift `
-D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib `
-D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include
- name: Build swift-llbuild
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-llbuild
- name: Configure swift-system
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-system `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-system
- name: Build swift-system
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-system
- name: Configure swift-tools-support-core
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-tools-support-core `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-tools-support-core `
-D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules `
-D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib `
-D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include
- name: Build swift-tools-support-core
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-tools-support-core
- name: Configure swift-driver
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-driver `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-driver `
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
-D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules `
-D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules `
-D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib `
-D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include `
-D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules `
-D Yams_DIR=${{ github.workspace }}/BinaryCache/yams/cmake/modules
- name: Build swift-driver
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-driver
- name: Configure swift-asn1
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-asn1 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-asn1
- name: Build swift-asn1
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-asn1
- name: Configure swift-certificates
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-certificates `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-certificates `
-D SwiftASN1_DIR=${{ github.workspace }}/BinaryCache/swift-asn1/cmake/modules `
-D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules
- name: Build swift-certificates
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-certificates
- name: extract swift-syntax
run: |
$module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake"
$bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax
(Get-Content $module).Replace('<BINARY_DIR>', "${bindir}") | Set-Content $module
- name: Configure swift-package-manager
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-package-manager `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-package-manager `
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
-D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules `
-D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include `
-D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib `
-D SwiftASN1_DIR=${{ github.workspace }}/BinaryCache/swift-asn1/cmake/modules `
-D SwiftCertificates_DIR=${{ github.workspace }}/BinaryCache/swift-certificates/cmake/modules `
-D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules `
-D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules `
-D SwiftDriver_DIR=${{ github.workspace }}/BinaryCache/swift-driver/cmake/modules `
-D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules `
-D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules `
-D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules `
-D Yams_DIR=${{ github.workspace }}/BinaryCache/yams/cmake/modules
- name: Build swift-package-manager
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-package-manager
- name: Configure Markdown
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-markdown `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-markdown `
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
-D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake
- name: Build Markdown
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-markdown
- name: Configure Format
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/swift-format `
-D BUILD_SHARED_LIBS=YES `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/swift-format `
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
-D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake `
-D SwiftMarkdown_DIR=${{ github.workspace }}/BinaryCache/swift-markdown/cmake/modules `
-D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules
- name: Build swift-format
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-format
- name: Configure IndexStoreDB
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/indexstore-db `
-D BUILD_SHARED_LIBS=NO `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} -Xclang -fno-split-cold-code" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -Xclang -fno-split-cold-code -I ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/include -I ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/include/Block" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/indexstore-db
- name: Build indexstore-db
run: cmake --build ${{ github.workspace }}/BinaryCache/indexstore-db
- name: Configure SourceKit-LSP
run: |
# Workaround CMake 3.20 issue
$CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe
$SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe
cmake -B ${{ github.workspace }}/BinaryCache/sourcekit-lsp `
-D BUILD_SHARED_LIBS=YES `
-D BUILD_TESTING=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} -Xclang -fno-split-cold-code" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -Xclang -fno-split-cold-code" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-G Ninja `
-S ${{ github.workspace }}/SourceCache/sourcekit-lsp `
-D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules `
-D IndexStoreDB_DIR=${{ github.workspace }}/BinaryCache/indexstore-db/cmake/modules `
-D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules `
-D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules `
-D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules `
-D SwiftPM_DIR=${{ github.workspace }}/BinaryCache/swift-package-manager/cmake/modules `
-D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules `
-D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules `
-D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules
- name: Build SourceKit-LSP
run: cmake --build ${{ github.workspace }}/BinaryCache/SourceKit-LSP
- name: Install swift-argument-parser
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-argument-parser --target install
- name: Install swift-collections
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-collections --target install
- name: Install swift-llbuild
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-llbuild --target install
- name: Install swift-system
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-system --target install
- name: Install swift-tools-support-core
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-tools-support-core --target install
- name: Install swift-driver
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-driver --target install
- name: Install swift-package-manager
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-package-manager --target install
- name: Install SourceKit-LSP
run: cmake --build ${{ github.workspace }}/BinaryCache/sourcekit-lsp --target install
- name: Install swift-format
run: cmake --build ${{ github.workspace }}/BinaryCache/swift-format --target install
- uses: actions/upload-artifact@v4
with:
name: devtools-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot-DevTools/Library
- name: Upload PDBs to Azure
uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache
searchPattern: '**/*.pdb'
- name: Upload DLLs to Azure
uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache
searchPattern: '**/*.dll'
- name: Upload EXEs to Azure
uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache
searchPattern: '**/*.exe'
debugging_tools:
name: Debugging Tools
needs: [context, compilers, devtools, sdk]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
cpu: x86_64
triple: x86_64-unknown-windows-msvc
- arch: arm64
cpu: aarch64
triple: aarch64-unknown-windows-msvc
steps:
- name: Download Compilers
uses: actions/download-artifact@v4
with:
name: compilers-amd64
path: ${{ github.workspace }}/BuildRoot/Library
- name: Download Devtools
uses: actions/download-artifact@v4
with:
name: devtools-amd64
path: ${{ github.workspace }}/BuildRoot/Library
- uses: actions/download-artifact@v4
with:
name: Windows-sdk-amd64
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
- name: Download SDK
uses: actions/download-artifact@v4
with:
name: Windows-sdk-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
- uses: actions/download-artifact@v4
with:
name: cmark-gfm-amd64-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
- name: cmark-gfm Setup
run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/
- uses: actions/download-artifact@v4
if: matrix.arch == 'arm64'
with:
name: cmark-gfm-arm64-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
- name: Update environment variables
run: |
$SDKRoot = cygpath -w "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk"
echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$ToolchainPath = cygpath -w "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin"
echo "${ToolchainPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "AR=${ToolchainPath}\llvm-ar.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$RTLPath = cygpath -w "${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin"
echo "${RTLPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- run: |
Move-Item ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/
Move-Item ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/
Move-Item ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/
Move-Item ${env:SDKROOT}/usr/lib/swift/_foundation_unicode ${env:SDKROOT}/usr/include
Move-Item ${env:SDKROOT}/usr/lib/swift/_FoundationCShims ${env:SDKROOT}/usr/include
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/_FoundationICU.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
- name: Checkout apple/swift
uses: actions/checkout@v4
with:
repository: apple/swift
ref: ${{ needs.context.outputs.swift_revision }}
path: ${{ github.workspace }}/SourceCache/swift
show-progress: false
- name: Build swift-inspect
id: swift_inspect
shell: cmd
run: |
swift build ^
--triple=${{ matrix.triple }} ^
--scratch-path="${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect" ^
--sdk="%SDKROOT%" ^
--package-path="${{ github.workspace }}/SourceCache/swift/tools/swift-inspect" ^
-c="release" ^
-Xbuild-tools-swiftc="-L%SDKROOT%/usr/lib/swift/windows" ^
-Xbuild-tools-swiftc="-I%SDKROOT%/usr/lib/swift" ^
-Xbuild-tools-swiftc="-use-ld=lld" ^
-Xcc="-I%SDKROOT%/usr/include/swift/SwiftRemoteMirror" ^
-Xswiftc="-use-ld=lld" ^
-Xlinker="%SDKROOT%/usr/lib/swift/windows/${{ matrix.cpu }}/swiftRemoteMirror.lib"
- name: Copy swift-inspect executable
run: |
New-Item -Path ${{ github.workspace }}/BuildRoot-DebuggingTools/swift-inspect -ItemType Directory -Force | Out-Null
$SwiftInspectPath="${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect/${{ matrix.triple }}/release/swift-inspect.exe"
Copy-Item ${SwiftInspectPath} -Destination "${{ github.workspace }}/BuildRoot-DebuggingTools/swift-inspect/"
- uses: actions/upload-artifact@v4
with:
name: debugging_tools-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot-DebuggingTools
package_tools:
name: Package Tools
needs: [context, compilers, debugging_tools, devtools]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
arch: ['amd64' , 'arm64']
steps:
- name: Download Debugging Tools
uses: actions/download-artifact@v4
with:
name: debugging_tools-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/DebuggingTools
- name: Download Compilers
uses: actions/download-artifact@v4
with:
name: compilers-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library
- name: Download DevTools
uses: actions/download-artifact@v4
with:
name: devtools-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library
- name: Download cmark-gfm
uses: actions/download-artifact@v4
with:
name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13
path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr
- name: cmark-gfm Setup
run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/
- uses: actions/checkout@v4
with:
repository: apple/swift-installer-scripts
ref: ${{ needs.context.outputs.swift_installer_scripts_revision }}
path: ${{ github.workspace }}/SourceCache/swift-installer-scripts
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- run: |
$CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64
$PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx
Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}'
certutil -decode $CertificatePath $PFXPath
Echo CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append
if: ${{ needs.context.outputs.signed }}
- name: Install WixToolset.Sdk
run: |
if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) {
if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) {
Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet
}
Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force
}
- name: Package Build Tools
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain `
-p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain `
-p:ProductArchitecture=${{ matrix.arch }} `
-p:ProductVersion=${{ needs.context.outputs.swift_version }} `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bld/bld.wixproj
- name: Package CLI Tools
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain `
-p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain `
-p:ProductArchitecture=${{ matrix.arch }} `
-p:ProductVersion=${{ needs.context.outputs.swift_version }} `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/cli/cli.wixproj
- name: Package Debugging Tools
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain `
-p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain `
-p:INCLUDE_SWIFT_INSPECT=true `
-p:SWIFT_INSPECT_BUILD=${{ github.workspace }}/BuildRoot/DebuggingTools/swift-inspect `
-p:ProductArchitecture=${{ matrix.arch }} `
-p:ProductVersion=${{ needs.context.outputs.swift_version }} `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/dbg/dbg.wixproj
- name: Package IDE Tools
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain `
-p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain `
-p:ProductArchitecture=${{ matrix.arch }} `
-p:ProductVersion=${{ needs.context.outputs.swift_version }} `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/ide/ide.wixproj
- uses: actions/upload-artifact@v4
with:
name: bld-${{ matrix.arch }}-msi
path: |
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/bld.msi
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/bld.cab
- uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.arch }}-msi
path: |
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/cli.msi
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/cli.cab
- uses: actions/upload-artifact@v4
with:
name: dbg-${{ matrix.arch }}-msi
path: |
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/dbg.msi
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/dbg.cab
- uses: actions/upload-artifact@v4
with:
name: ide-${{ matrix.arch }}-msi
path: |
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.msi
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.cab
package_sdk_runtime:
name: Package Windows SDK & Runtime
needs: [context, sdk]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
platform: x64
- arch: arm64
platform: arm64
- arch: x86
platform: x86
steps:
- uses: actions/download-artifact@v4
with:
name: Windows-sdk-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
- uses: actions/checkout@v4
with:
repository: apple/swift-installer-scripts
ref: ${{ needs.context.outputs.swift_installer_scripts_revision }}
path: ${{ github.workspace }}/SourceCache/swift-installer-scripts
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- run: |
$CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64
$PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx
Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}'
certutil.exe -decode $CertificatePath $PFXPath
Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append
if: ${{ needs.context.outputs.signed }}
- name: Install WixToolset.Sdk
run: |
if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) {
if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) {
Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet
}
Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force
}
- name: Package SDK
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform `
-p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk `
-p:ProductVersion=${{ needs.context.outputs.swift_version }} `
-p:ProductArchitecture=${{ matrix.arch }} `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/sdk/sdk.wixproj
- name: Package Runtime
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform `
-p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk `
-p:ProductVersion=${{ needs.context.outputs.swift_version }} `
-p:ProductArchitecture=${{ matrix.arch }} `
-p:VCRedistDir="${env:VCToolsRedistDir}\${env:VSCMD_ARG_TGT_ARCH}\Microsoft.VC143.CRT\" `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/rtl/msi/rtlmsi.wixproj
- uses: actions/upload-artifact@v4
with:
name: sdk-windows-${{ matrix.arch }}-msi
path: |
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/sdk.${{ matrix.arch }}.msi
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/sdk.${{ matrix.arch }}.cab
- uses: actions/upload-artifact@v4
with:
name: rtl-windows-${{ matrix.arch }}-msi
path: |
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.msi
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.cab
- uses: actions/upload-artifact@v4
with:
name: rtl-windows-${{ matrix.arch }}-msm
path: |
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.msm
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.cab
package_android_sdk:
name: Package Android SDK & Runtime
needs: [context, sdk]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
cpu: aarch64
- arch: armv7
cpu: armv7
- arch: i686
cpu: i686
- arch: x86_64
cpu: x86_64
steps:
- uses: actions/download-artifact@v4
with:
name: Android-sdk-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform
- uses: actions/checkout@v4
with:
repository: apple/swift-installer-scripts
ref: e1adc0d5dde137fa5941316e89a3ed139a273dde
path: ${{ github.workspace }}/SourceCache/swift-installer-scripts
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- run: |
$CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64
$PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx
Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}'
certutil.exe -decode $CertificatePath $PFXPath
Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append
if: ${{ needs.context.outputs.signed }}
- name: Install WixToolset.Sdk
run: |
if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) {
if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) {
Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet
}
Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force
}
- name: Package SDK
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform `
-p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform/Developer/SDKs/Android.sdk `
-p:ProductVersion=${{ needs.context.outputs.swift_version }} `
-p:ProductArchitecture=${{ matrix.cpu }} `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/android_sdk/android_sdk.wixproj
- uses: actions/upload-artifact@v4
with:
name: sdk-android-${{ matrix.arch }}-msi
path: |
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.cpu }}/android_sdk.${{ matrix.cpu }}.msi
${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.cpu }}/android_sdk.${{ matrix.cpu }}.cab
installer:
needs: [context, package_tools, package_sdk_runtime, package_android_sdk]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
arch: ['amd64' , 'arm64']
steps:
- uses: actions/download-artifact@v4
with:
name: bld-${{ matrix.arch }}-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}
- uses: actions/download-artifact@v4
with:
name: cli-${{ matrix.arch }}-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}
- uses: actions/download-artifact@v4
with:
name: dbg-${{ matrix.arch }}-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}
- uses: actions/download-artifact@v4
with:
name: ide-${{ matrix.arch }}-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}
- uses: actions/download-artifact@v4
with:
name: rtl-windows-${{ matrix.arch }}-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}
- uses: actions/download-artifact@v4
with:
name: rtl-windows-amd64-msm
path: ${{ github.workspace }}/BinaryCache/installer/Release/amd64
- uses: actions/download-artifact@v4
with:
name: rtl-windows-x86-msm
path: ${{ github.workspace }}/BinaryCache/installer/Release/x86
- uses: actions/download-artifact@v4
with:
name: rtl-windows-arm64-msm
path: ${{ github.workspace }}/BinaryCache/installer/Release/arm64
- uses: actions/download-artifact@v4
with:
name: sdk-windows-amd64-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/amd64
- uses: actions/download-artifact@v4
with:
name: sdk-windows-x86-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/x86
- uses: actions/download-artifact@v4
with:
name: sdk-windows-arm64-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/arm64
- uses: actions/download-artifact@v4
with:
name: sdk-android-arm64-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/aarch64
- uses: actions/download-artifact@v4
with:
name: sdk-android-x86_64-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/x86_64
- uses: actions/download-artifact@v4
with:
name: sdk-android-armv7-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/armv7
- uses: actions/download-artifact@v4
with:
name: sdk-android-i686-msi
path: ${{ github.workspace }}/BinaryCache/installer/Release/i686
- uses: actions/checkout@v4
with:
repository: apple/swift-installer-scripts
ref: ${{ needs.context.outputs.swift_installer_scripts_revision }}
path: ${{ github.workspace }}/SourceCache/swift-installer-scripts
show-progress: false
- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}
- run: |
$CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64
$PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx
Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}'
certutil -decode $CertificatePath $PFXPath
Echo CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append
if: ${{ needs.context.outputs.signed }}
# TODO(issues/154): Preload WixToolset.Sdk on Azure images so we can remove this step.
- name: Install WixToolset.Sdk
run: |
if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) {
Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet
}
Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force
# The installer bundle needs the shared project for localization strings,
# but it won't build the dependency on its own due to -p:BuildProjectReferences=false.
- name: Build shared project
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:ProductArchitecture=${{ matrix.arch }} `
-p:ProductVersion=${{ needs.context.outputs.swift_version }}-${{ needs.context.outputs.swift_tag }} `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/shared/shared.wixproj
- name: Build installer bundle
run: |
msbuild -nologo -restore -maxCpuCount `
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
-p:Configuration=Release `
-p:BuildProjectReferences=false `
-p:SignOutput=${{ needs.context.outputs.signed }} `
-p:CERTIFICATE=${env:CERTIFICATE} `
-p:PASSPHRASE=${{ secrets.PASSPHRASE }} `
-p:BundleFlavor=offline `
-p:INCLUDE_AMD64_SDK=true `
-p:INCLUDE_X86_SDK=true `
-p:INCLUDE_ARM64_SDK=true `
-p:ANDROID_INCLUDE_ARM64_SDK=true `
-p:ANDROID_INCLUDE_x86_64_SDK=true `
-p:ANDROID_INCLUDE_ARM_SDK=true `
-p:ANDROID_INCLUDE_X86_SDK=true `
-p:ProductArchitecture=${{ matrix.arch }} `
-p:ProductVersion=${{ needs.context.outputs.swift_version }}-${{ needs.context.outputs.swift_tag }} `
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bundle/installer.wixproj
- uses: actions/upload-artifact@v4
with:
name: installer-${{ matrix.arch }}
path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/installer.exe
smoke_test:
needs: [context, installer]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
steps:
- uses: actions/download-artifact@v4
with:
name: installer-amd64
path: ${{ github.workspace }}/tmp
# TODO(compnerd): migrate this to compnerd/gha-setup-swift after the work that @mangini is doing is completed
- run: |
function Update-EnvironmentVariables {
foreach ($level in "Machine", "User") {
[Environment]::GetEnvironmentVariables($level).GetEnumerator() | % {
# For Path variables, append the new values, if they're not already in there
if ($_.Name -Match 'Path$') {
$_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';'
}
$_
} | Set-Content -Path { "Env:$($_.Name)" }
}
}
try {
Write-Host "Starting Install installer.exe..."
$Process = Start-Process -FilePath ${{ github.workspace }}/tmp/installer.exe -ArgumentList ("-q") -Wait -PassThru
$ExitCode = $Process.ExitCode
if ($ExitCode -eq 0 -or $ExitCode -eq 3010) {
Write-Host "Installation successful"
} else {
Write-Host "non-zero exit code returned by the installation process: $ExitCode"
exit $ExitCode
}
} catch {
Write-Host "Failed to install: $($_.Exception.Message)"
exit 1
}
Update-EnvironmentVariables
# Reset Path and environment
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append }
- uses: actions/checkout@v4
with:
repository: compnerd/swift-win32
ref: refs/heads/main
path: ${{ github.workspace }}/SourceCache/swift-win32
show-progress: false
- run: swift build
working-directory: ${{ github.workspace }}/SourceCache/swift-win32
- run: swift test -Xswiftc -DENABLE_TESTING
working-directory: ${{ github.workspace }}/SourceCache/swift-win32
snapshot:
runs-on: ubuntu-latest
needs: [context, smoke_test]
if: github.event_name == 'schedule'
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/main
show-progress: false
- uses: actions/download-artifact@v4
with:
name: stable.xml
- run: |
git config --global user.name 'github-action[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if ! git diff --exit-code ; then
git add stable.xml
git commit -m "repo: update stable revision snapshot ${{ needs.context.outputs.swift_tag }}"
git push origin HEAD:main
fi
release:
runs-on: ubuntu-latest
needs: [context, smoke_test]
if: inputs.create_release == true
steps:
- uses: actions/download-artifact@v4
with:
name: installer-amd64
path: ${{ github.workspace }}/tmp/amd64
- uses: actions/download-artifact@v4
with:
name: installer-arm64
path: ${{ github.workspace }}/tmp/arm64
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create Release
gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }}
# AMD64
cd ${{ github.workspace }}/tmp/amd64
mv installer.exe installer-amd64.exe
gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe -R ${{ github.repository }}
shasum -a 256 installer-amd64.exe > installer-amd64.exe.sha256
gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe.sha256 -R ${{ github.repository }}
# ARM64
cd ${{ github.workspace }}/tmp/arm64
mv installer.exe installer-arm64.exe
gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe -R ${{ github.repository }}
shasum -a 256 installer-arm64.exe > installer-arm64.exe.sha256
gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe.sha256 -R ${{ github.repository }}