| ... | ... | @@ -37,8 +37,8 @@ jobs: |
| 37 | 37 | displayName: 'Install ZIG/LLVM/CLANG/LLD' |
| 38 | 38 | |
| 39 | 39 | - pwsh: | |
| 40 | | Set-Variable -Name ZIGBUILDDIR -Value "$(Get-Location)\build" |
| 41 | | Set-Variable -Name ZIGINSTALLDIR -Value "${ZIGBUILDDIR}\dist" |
| 40 | Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib" |
| 41 | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release" |
| 42 | 42 | Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$(ZIG_LLVM_CLANG_LLD_NAME)" |
| 43 | 43 | |
| 44 | 44 | function CheckLastExitCode { |
| ... | ... | @@ -56,13 +56,10 @@ jobs: |
| 56 | 56 | git fetch --unshallow # `git describe` won't work on a shallow repo |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | | mkdir $ZIGBUILDDIR |
| 60 | | cd $ZIGBUILDDIR |
| 61 | | |
| 62 | 59 | & "$ZIGPREFIXPATH\bin\zig.exe" build ` |
| 63 | 60 | --prefix "$ZIGINSTALLDIR" ` |
| 64 | 61 | --search-prefix "$ZIGPREFIXPATH" ` |
| 65 | | --zig-lib-dir "..\lib" ` |
| 62 | --zig-lib-dir "$ZIGLIBDIR" ` |
| 66 | 63 | -Denable-stage1 ` |
| 67 | 64 | -Dstatic-llvm ` |
| 68 | 65 | -Drelease ` |
| ... | ... | @@ -70,13 +67,11 @@ jobs: |
| 70 | 67 | -Duse-zig-libcxx ` |
| 71 | 68 | -Dtarget=$(TARGET) |
| 72 | 69 | CheckLastExitCode |
| 73 | | |
| 74 | | cd - |
| 75 | 70 | name: build |
| 76 | 71 | displayName: 'Build' |
| 77 | 72 | |
| 78 | 73 | - pwsh: | |
| 79 | | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\build\dist" |
| 74 | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release" |
| 80 | 75 | |
| 81 | 76 | function CheckLastExitCode { |
| 82 | 77 | if (!$?) { |
| ... | ... | @@ -85,39 +80,21 @@ jobs: |
| 85 | 80 | return 0 |
| 86 | 81 | } |
| 87 | 82 | |
| 88 | | & "$ZIGINSTALLDIR\bin\zig.exe" build test ` |
| 83 | & "$ZIGINSTALLDIR\bin\zig.exe" build test docs ` |
| 89 | 84 | --search-prefix "$ZIGPREFIXPATH" ` |
| 90 | 85 | -Dstatic-llvm ` |
| 91 | 86 | -Dskip-non-native ` |
| 92 | 87 | -Dskip-stage2-tests |
| 93 | 88 | CheckLastExitCode |
| 94 | | |
| 95 | 89 | name: test |
| 96 | 90 | displayName: 'Test' |
| 97 | 91 | |
| 98 | | - pwsh: | |
| 99 | | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\build\dist" |
| 100 | | |
| 101 | | function CheckLastExitCode { |
| 102 | | if (!$?) { |
| 103 | | exit 1 |
| 104 | | } |
| 105 | | return 0 |
| 106 | | } |
| 107 | | |
| 108 | | & "$ZIGINSTALLDIR\bin\zig.exe" build docs |
| 109 | | CheckLastExitCode |
| 110 | | timeoutInMinutes: 60 |
| 111 | | name: doc |
| 112 | | displayName: 'Documentation' |
| 113 | | |
| 114 | 92 | - task: DownloadSecureFile@1 |
| 115 | 93 | inputs: |
| 116 | 94 | name: aws_credentials |
| 117 | 95 | secureFile: aws_credentials |
| 118 | 96 | |
| 119 | 97 | - pwsh: | |
| 120 | | Set-Variable -Name ZIGBUILDDIR -Value "$(Get-Location)\build" |
| 121 | 98 | $Env:AWS_SHARED_CREDENTIALS_FILE = "$Env:DOWNLOADSECUREFILE_SECUREFILEPATH" |
| 122 | 99 | |
| 123 | 100 | # Workaround Azure networking issue |
| ... | ... | @@ -125,21 +102,20 @@ jobs: |
| 125 | 102 | $Env:AWS_EC2_METADATA_DISABLED = "true" |
| 126 | 103 | $Env:AWS_REGION = "us-west-2" |
| 127 | 104 | |
| 128 | | cd "$ZIGBUILDDIR" |
| 129 | | mv ../LICENSE dist/ |
| 130 | | mv ../zig-cache/langref.html dist/ |
| 131 | | mv dist/bin/zig.exe dist/ |
| 132 | | rmdir dist/bin |
| 105 | mv LICENSE stage3-release/ |
| 106 | mv zig-cache/langref.html stage3-release/ |
| 107 | mv stage3-release/bin/zig.exe stage3-release/ |
| 108 | rmdir stage3-release/bin |
| 133 | 109 | |
| 134 | 110 | # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig |
| 135 | | mv dist/lib/zig dist/lib2 |
| 136 | | rmdir dist/lib |
| 137 | | mv dist/lib2 dist/lib |
| 111 | mv stage3-release/lib/zig stage3-release/lib2 |
| 112 | rmdir stage3-release/lib |
| 113 | mv stage3-release/lib2 stage3-release/lib |
| 138 | 114 | |
| 139 | | Set-Variable -Name VERSION -Value $(./dist/zig.exe version) |
| 115 | Set-Variable -Name VERSION -Value $(./stage3-release/zig.exe version) |
| 140 | 116 | Set-Variable -Name DIRNAME -Value "zig-windows-x86_64-$VERSION" |
| 141 | 117 | Set-Variable -Name TARBALL -Value "$DIRNAME.zip" |
| 142 | | mv dist "$DIRNAME" |
| 118 | mv stage3-release "$DIRNAME" |
| 143 | 119 | 7z a "$TARBALL" "$DIRNAME" |
| 144 | 120 | |
| 145 | 121 | aws s3 cp ` |