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:...@@ -37,8 +37,8 @@ jobs:
37 displayName: 'Install ZIG/LLVM/CLANG/LLD'37 displayName: 'Install ZIG/LLVM/CLANG/LLD'
3838
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)"
4343
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 repo56 git fetch --unshallow # `git describe` won't work on a shallow repo
57 }57 }
5858
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 CheckLastExitCode69 CheckLastExitCode
73
74 cd -
75 name: build70 name: build
76 displayName: 'Build'71 displayName: 'Build'
7772
78 - pwsh: |73 - pwsh: |
79 Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\build\dist"74 Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release"
8075
81 function CheckLastExitCode {76 function CheckLastExitCode {
82 if (!$?) {77 if (!$?) {
...@@ -85,39 +80,21 @@ jobs:...@@ -85,39 +80,21 @@ jobs:
85 return 080 return 0
86 }81 }
8782
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-tests87 -Dskip-stage2-tests
93 CheckLastExitCode88 CheckLastExitCode
94
95 name: test89 name: test
96 displayName: 'Test'90 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
114 - task: DownloadSecureFile@192 - task: DownloadSecureFile@1
115 inputs:93 inputs:
116 name: aws_credentials94 name: aws_credentials
117 secureFile: aws_credentials95 secureFile: aws_credentials
11896
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"
12299
123 # Workaround Azure networking issue100 # 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"
127104
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
133109
134 # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig110 # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig
135 mv dist/lib/zig dist/lib2111 mv stage3-release/lib/zig stage3-release/lib2
136 rmdir dist/lib112 rmdir stage3-release/lib
137 mv dist/lib2 dist/lib113 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)
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"
144120
145 aws s3 cp `121 aws s3 cp `