authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-17 23:34:57-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-19 16:45:16-07:00
log35f62bc7aeca5c84f4ddda5736ce902018d23964
tree07389344bee90997d0058843154a1357ab17e135
parentc4466496ffb53fe83644ea2b0e43f9f46a3361b8

CI: windows: don't create build directory

Simplify the script by not creating an unnecessary build directory and then changing directories to and from it.

1 files changed, 14 insertions(+), 38 deletions(-)

ci/azure/pipelines.yml+14-38
......@@ -37,8 +37,8 @@ jobs:
3737 displayName: 'Install ZIG/LLVM/CLANG/LLD'
3838
3939 - 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"
4242 Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$(ZIG_LLVM_CLANG_LLD_NAME)"
4343
4444 function CheckLastExitCode {
......@@ -56,13 +56,10 @@ jobs:
5656 git fetch --unshallow # `git describe` won't work on a shallow repo
5757 }
5858
59 mkdir $ZIGBUILDDIR
60 cd $ZIGBUILDDIR
61
6259 & "$ZIGPREFIXPATH\bin\zig.exe" build `
6360 --prefix "$ZIGINSTALLDIR" `
6461 --search-prefix "$ZIGPREFIXPATH" `
65 --zig-lib-dir "..\lib" `
62 --zig-lib-dir "$ZIGLIBDIR" `
6663 -Denable-stage1 `
6764 -Dstatic-llvm `
6865 -Drelease `
......@@ -70,13 +67,11 @@ jobs:
7067 -Duse-zig-libcxx `
7168 -Dtarget=$(TARGET)
7269 CheckLastExitCode
73
74 cd -
7570 name: build
7671 displayName: 'Build'
7772
7873 - pwsh: |
79 Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\build\dist"
74 Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release"
8075
8176 function CheckLastExitCode {
8277 if (!$?) {
......@@ -85,39 +80,21 @@ jobs:
8580 return 0
8681 }
8782
88 & "$ZIGINSTALLDIR\bin\zig.exe" build test `
83 & "$ZIGINSTALLDIR\bin\zig.exe" build test docs `
8984 --search-prefix "$ZIGPREFIXPATH" `
9085 -Dstatic-llvm `
9186 -Dskip-non-native `
9287 -Dskip-stage2-tests
9388 CheckLastExitCode
94
9589 name: test
9690 displayName: 'Test'
9791
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
11492 - task: DownloadSecureFile@1
11593 inputs:
11694 name: aws_credentials
11795 secureFile: aws_credentials
11896
11997 - pwsh: |
120 Set-Variable -Name ZIGBUILDDIR -Value "$(Get-Location)\build"
12198 $Env:AWS_SHARED_CREDENTIALS_FILE = "$Env:DOWNLOADSECUREFILE_SECUREFILEPATH"
12299
123100 # Workaround Azure networking issue
......@@ -125,21 +102,20 @@ jobs:
125102 $Env:AWS_EC2_METADATA_DISABLED = "true"
126103 $Env:AWS_REGION = "us-west-2"
127104
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
133109
134110 # 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
138114
139 Set-Variable -Name VERSION -Value $(./dist/zig.exe version)
115 Set-Variable -Name VERSION -Value $(./stage3-release/zig.exe version)
140116 Set-Variable -Name DIRNAME -Value "zig-windows-x86_64-$VERSION"
141117 Set-Variable -Name TARBALL -Value "$DIRNAME.zip"
142 mv dist "$DIRNAME"
118 mv stage3-release "$DIRNAME"
143119 7z a "$TARBALL" "$DIRNAME"
144120
145121 aws s3 cp `