f4980a4800
needed because of some changes to std.dwarf
173 lines
5.2 KiB
YAML
173 lines
5.2 KiB
YAML
jobs:
|
|
- job: BuildMacOS
|
|
pool:
|
|
vmImage: 'macOS-11'
|
|
timeoutInMinutes: 360
|
|
steps:
|
|
- task: DownloadSecureFile@1
|
|
inputs:
|
|
secureFile: s3cfg
|
|
- script: ci/azure/macos_script
|
|
name: main
|
|
displayName: 'Build and test'
|
|
- job: BuildMacOS_arm64
|
|
pool:
|
|
vmImage: 'macOS-11'
|
|
timeoutInMinutes: 180
|
|
steps:
|
|
- task: DownloadSecureFile@1
|
|
inputs:
|
|
secureFile: s3cfg
|
|
- script: ci/azure/macos_arm64_script
|
|
name: main
|
|
displayName: 'Build'
|
|
- job: BuildWindows
|
|
timeoutInMinutes: 360
|
|
pool:
|
|
vmImage: 'windows-2019'
|
|
variables:
|
|
TARGET: 'x86_64-windows-gnu'
|
|
ZIG_LLVM_CLANG_LLD_NAME: 'zig+llvm+lld+clang-${{ variables.TARGET }}-0.10.0-dev.3733+a9af47272'
|
|
ZIG_LLVM_CLANG_LLD_URL: 'https://ziglang.org/deps/${{ variables.ZIG_LLVM_CLANG_LLD_NAME }}.zip'
|
|
steps:
|
|
- pwsh: |
|
|
(New-Object Net.WebClient).DownloadFile("$(ZIG_LLVM_CLANG_LLD_URL)", "${ZIG_LLVM_CLANG_LLD_NAME}.zip")
|
|
& 'C:\Program Files\7-Zip\7z.exe' x "${ZIG_LLVM_CLANG_LLD_NAME}.zip"
|
|
name: install
|
|
displayName: 'Install ZIG/LLVM/CLANG/LLD'
|
|
|
|
- pwsh: |
|
|
Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib"
|
|
Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release"
|
|
Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$(ZIG_LLVM_CLANG_LLD_NAME)"
|
|
|
|
function CheckLastExitCode {
|
|
if (!$?) {
|
|
exit 1
|
|
}
|
|
return 0
|
|
}
|
|
|
|
# Make the `zig version` number consistent.
|
|
# This will affect the `zig build` command below which uses `git describe`.
|
|
git config core.abbrev 9
|
|
git fetch --tags
|
|
if ((git rev-parse --is-shallow-repository) -eq "true") {
|
|
git fetch --unshallow # `git describe` won't work on a shallow repo
|
|
}
|
|
|
|
& "$ZIGPREFIXPATH\bin\zig.exe" build `
|
|
--prefix "$ZIGINSTALLDIR" `
|
|
--search-prefix "$ZIGPREFIXPATH" `
|
|
--zig-lib-dir "$ZIGLIBDIR" `
|
|
-Denable-stage1 `
|
|
-Dstatic-llvm `
|
|
-Drelease `
|
|
-Dstrip `
|
|
-Duse-zig-libcxx `
|
|
-Dtarget=$(TARGET)
|
|
CheckLastExitCode
|
|
name: build
|
|
displayName: 'Build'
|
|
|
|
- pwsh: |
|
|
Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release"
|
|
|
|
function CheckLastExitCode {
|
|
if (!$?) {
|
|
exit 1
|
|
}
|
|
return 0
|
|
}
|
|
|
|
& "$ZIGINSTALLDIR\bin\zig.exe" build test docs `
|
|
--search-prefix "$ZIGPREFIXPATH" `
|
|
-Dstatic-llvm `
|
|
-Dskip-non-native `
|
|
-Dskip-stage2-tests
|
|
CheckLastExitCode
|
|
name: test
|
|
displayName: 'Test'
|
|
|
|
- task: DownloadSecureFile@1
|
|
inputs:
|
|
name: aws_credentials
|
|
secureFile: aws_credentials
|
|
|
|
- pwsh: |
|
|
$Env:AWS_SHARED_CREDENTIALS_FILE = "$Env:DOWNLOADSECUREFILE_SECUREFILEPATH"
|
|
|
|
# Workaround Azure networking issue
|
|
# https://github.com/aws/aws-cli/issues/5749
|
|
$Env:AWS_EC2_METADATA_DISABLED = "true"
|
|
$Env:AWS_REGION = "us-west-2"
|
|
|
|
mv LICENSE stage3-release/
|
|
mv zig-cache/langref.html stage3-release/
|
|
mv stage3-release/bin/zig.exe stage3-release/
|
|
rmdir stage3-release/bin
|
|
|
|
# Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig
|
|
mv stage3-release/lib/zig stage3-release/lib2
|
|
rmdir stage3-release/lib
|
|
mv stage3-release/lib2 stage3-release/lib
|
|
|
|
Set-Variable -Name VERSION -Value $(./stage3-release/zig.exe version)
|
|
Set-Variable -Name DIRNAME -Value "zig-windows-x86_64-$VERSION"
|
|
Set-Variable -Name TARBALL -Value "$DIRNAME.zip"
|
|
mv stage3-release "$DIRNAME"
|
|
7z a "$TARBALL" "$DIRNAME"
|
|
|
|
aws s3 cp `
|
|
"$TARBALL" `
|
|
s3://ziglang.org/builds/ `
|
|
--acl public-read `
|
|
--cache-control 'public, max-age=31536000, immutable'
|
|
|
|
Set-Variable -Name SHASUM -Value (Get-FileHash "$TARBALL" -Algorithm SHA256 | select-object -ExpandProperty Hash).ToLower()
|
|
Set-Variable -Name BYTESIZE -Value (Get-Item "$TARBALL").length
|
|
|
|
Set-Variable -Name JSONFILE -Value "windows-${Env:BUILD_SOURCEBRANCHNAME}.json"
|
|
echo $null > $JSONFILE
|
|
echo ('{"tarball": "' + $TARBALL + '",') >> $JSONFILE
|
|
echo ('"shasum": "' + $SHASUM + '",') >> $JSONFILE
|
|
echo ('"size": ' + $BYTESIZE + '}' ) >> $JSONFILE
|
|
|
|
aws s3 cp `
|
|
"$JSONFILE" `
|
|
s3://ziglang.org/builds/ `
|
|
--acl public-read `
|
|
--cache-control 'max-age=0, must-revalidate'
|
|
|
|
aws s3 cp `
|
|
"$JSONFILE" `
|
|
"s3://ziglang.org/builds/x86_64-windows-${VERSION}.json" `
|
|
--acl public-read
|
|
|
|
echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL"
|
|
echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM"
|
|
echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE"
|
|
|
|
name: upload
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
|
|
displayName: 'Upload'
|
|
|
|
- job: OnMasterSuccess
|
|
dependsOn:
|
|
- BuildMacOS
|
|
- BuildMacOS_arm64
|
|
- BuildWindows
|
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
|
strategy:
|
|
maxParallel: 1
|
|
pool:
|
|
vmImage: 'ubuntu-20.04'
|
|
variables:
|
|
version: $[ dependencies.BuildMacOS.outputs['main.version'] ]
|
|
steps:
|
|
- task: DownloadSecureFile@1
|
|
inputs:
|
|
secureFile: oauth_token
|
|
- script: ci/azure/on_master_success
|
|
displayName: 'master branch success hook'
|