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