File tree 21 files changed +337
-0
lines changed
21 files changed +337
-0
lines changed Original file line number Diff line number Diff line change 46
46
` ` `
47
47
48
48
The setup task will now call the `yamlfmt` libraries `install` task.
49
+
50
+ # # Windows
51
+
52
+ On Windows by default tools get installed in `${HOME}/tools`. Make sure to add this to your path.
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
5
+ install :
6
+ silent : true
7
+ vars :
8
+ MSI : dotnet-sdk-6.0.413-win-x64.exe
9
+ URL : https://download.visualstudio.microsoft.com/download/pr/8d1443fd-a5e1-438d-8cb8-6ccb9849a54a/4f89f2b74a9c272789dfac8658a87673/dotnet-sdk-6.0.413-win-x64.exe
10
+ VERSION : " 6.0.413"
11
+ CHECKSUM : d3e8273d451b3bc15cd8f656ffdaaff4d1b0d17059ada578967063f4b9882b74926af61c6e0919f66b5bdeddd66e5047743544ac4768026b60de7a7591e1fab5
12
+ TEMP_DIR :
13
+ sh : |
14
+ powershell '
15
+ $parent = [System.IO.Path]::GetTempPath()
16
+ $name = [System.IO.Path]::GetRandomFileName()
17
+ $path = (Join-Path $parent $name)
18
+ mkdir $path | Out-Null
19
+ Write-Output $path
20
+ '
21
+ status :
22
+ - |
23
+ powershell '
24
+ $results = dotnet --list-sdks | Select-String "{{.VERSION}}"
25
+ if ($results -eq $null) {
26
+ Exit 1
27
+ }
28
+ '
29
+ cmds :
30
+ - defer : |
31
+ powershell '
32
+ Remove-Item -Recurse {{.TEMP_DIR}}
33
+ '
34
+ # Download
35
+ - |
36
+ powershell '
37
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
38
+ Write-Output "Downloading to $msi_path"
39
+ $ProgressPreference = "SilentlyContinue"
40
+ Invoke-WebRequest -Uri "{{.URL}}" -OutFile $msi_path
41
+ '
42
+ # Checksum Verification
43
+ - |
44
+ powershell '
45
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
46
+ Write-Output "Verifying checksum"
47
+ $FileHash = Get-FileHash $msi_path -Algorithm SHA512
48
+ if ($FileHash.Hash -ne "{{.CHECKSUM}}") {
49
+ Write-Output "Checksums don't match, won't install."
50
+ Exit 1
51
+ }
52
+ '
53
+ # Install
54
+ - |
55
+ powershell '
56
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
57
+ Write-Output "Running installer"
58
+ Start-Process -FilePath "$msi_path" -Wait
59
+ '
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
5
+ install :
6
+ silent : true
7
+ vars :
8
+ MSI : dotnet-sdk-7.0.400-win-x64.exe
9
+ URL : https://download.visualstudio.microsoft.com/download/pr/e3f91c3f-dbcc-44cb-a319-9cb15c9b61b9/6c87d96b2294afed74ccf414e7747b5a/dotnet-sdk-7.0.400-win-x64.exe
10
+ VERSION : " 7.0.400"
11
+ CHECKSUM : d8a8b063845b4ad4a1ac2c5a18de5fd478acfc021b2aaffdf59435684bfcb5b0ccd35c52139bd972b80e3f6314f3c2b74c2cc7228e223ed406df5e5369df35fc
12
+ TEMP_DIR :
13
+ sh : |
14
+ powershell '
15
+ $parent = [System.IO.Path]::GetTempPath()
16
+ $name = [System.IO.Path]::GetRandomFileName()
17
+ $path = (Join-Path $parent $name)
18
+ mkdir $path | Out-Null
19
+ Write-Output $path
20
+ '
21
+ status :
22
+ - |
23
+ powershell '
24
+ $results = dotnet --list-sdks | Select-String "{{.VERSION}}"
25
+ if ($results -eq $null) {
26
+ Exit 1
27
+ }
28
+ '
29
+ cmds :
30
+ - defer : |
31
+ powershell '
32
+ Remove-Item -Recurse {{.TEMP_DIR}}
33
+ '
34
+ # Download
35
+ - |
36
+ powershell '
37
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
38
+ Write-Output "Downloading to $msi_path"
39
+ $ProgressPreference = "SilentlyContinue"
40
+ Invoke-WebRequest -Uri "{{.URL}}" -OutFile $msi_path
41
+ '
42
+ # Checksum Verification
43
+ - |
44
+ powershell '
45
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
46
+ Write-Output "Verifying checksum"
47
+ $FileHash = Get-FileHash $msi_path -Algorithm SHA512
48
+ if ($FileHash.Hash -ne "{{.CHECKSUM}}") {
49
+ Write-Output "Checksums don't match, won't install."
50
+ Exit 1
51
+ }
52
+ '
53
+ # Install
54
+ - |
55
+ powershell '
56
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
57
+ Write-Output "Running installer"
58
+ Start-Process -FilePath "$msi_path" -Wait
59
+ '
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
5
+ install :
6
+ silent : true
7
+ vars :
8
+ MSI : go1.20.7.windows-amd64.msi
9
+ URL : https://go.dev/dl/go1.20.7.windows-amd64.msi
10
+ VERSION : go1.20
11
+ CHECKSUM : f5c24c6ff240f6d4b94a2bd92ba97f5d7ae01f058b3ea38438c0a2ae84e3c368
12
+ TEMP_DIR :
13
+ sh : |
14
+ powershell '
15
+ $parent = [System.IO.Path]::GetTempPath()
16
+ $name = [System.IO.Path]::GetRandomFileName()
17
+ $path = (Join-Path $parent $name)
18
+ mkdir $path | Out-Null
19
+ Write-Output $path
20
+ '
21
+ status :
22
+ - |
23
+ powershell '
24
+ $results = go version | Select-String "go version {{.VERSION}}"
25
+ if ($results -eq $null) {
26
+ Exit 1
27
+ }
28
+ '
29
+ cmds :
30
+ - defer : |
31
+ powershell '
32
+ Remove-Item -Recurse {{.TEMP_DIR}}
33
+ '
34
+ # Download
35
+ - |
36
+ powershell '
37
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
38
+ Write-Output "Downloading to $msi_path"
39
+ $ProgressPreference = "SilentlyContinue"
40
+ Invoke-WebRequest -Uri "{{.URL}}" -OutFile $msi_path
41
+ '
42
+ # Checksum Verification
43
+ - |
44
+ powershell '
45
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
46
+ Write-Output "Verifying checksum"
47
+ $FileHash = Get-FileHash $msi_path
48
+ if ($FileHash.Hash -ne "{{.CHECKSUM}}") {
49
+ Write-Output "Checksums don't match, won't install."
50
+ Exit 1
51
+ }
52
+ '
53
+ # Install
54
+ - |
55
+ powershell '
56
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
57
+ Write-Output "Running installer"
58
+ $log_path = (Join-Path "{{.TEMP_DIR}}" "msiexec.log")
59
+ Start-Process -FilePath "msiexec.exe" -Wait -ArgumentList "/i $msi_path /passive /l*v $log_path"
60
+ '
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
5
+ install :
6
+ silent : true
7
+ vars :
8
+ MSI : go1.21.0.windows-amd64.msi
9
+ URL : https://go.dev/dl/go1.21.0.windows-amd64.msi
10
+ VERSION : go1.21
11
+ CHECKSUM : 3428c547527a4513597b921e46138c835d6e7636f93265ff96e23d0bdf0863a4
12
+ TEMP_DIR :
13
+ sh : |
14
+ powershell '
15
+ $parent = [System.IO.Path]::GetTempPath()
16
+ $name = [System.IO.Path]::GetRandomFileName()
17
+ $path = (Join-Path $parent $name)
18
+ mkdir $path | Out-Null
19
+ Write-Output $path
20
+ '
21
+ status :
22
+ - |
23
+ powershell '
24
+ $results = go version | Select-String "go version {{.VERSION}}"
25
+ if ($results -eq $null) {
26
+ Exit 1
27
+ }
28
+ '
29
+ cmds :
30
+ - defer : |
31
+ powershell '
32
+ Remove-Item -Recurse {{.TEMP_DIR}}
33
+ '
34
+ # Download
35
+ - |
36
+ powershell '
37
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
38
+ Write-Output "Downloading to $msi_path"
39
+ $ProgressPreference = "SilentlyContinue"
40
+ Invoke-WebRequest -Uri "{{.URL}}" -OutFile $msi_path
41
+ '
42
+ # Checksum Verification
43
+ - |
44
+ powershell '
45
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
46
+ Write-Output "Verifying checksum"
47
+ $FileHash = Get-FileHash $msi_path
48
+ if ($FileHash.Hash -ne "{{.CHECKSUM}}") {
49
+ Write-Output "Checksums don't match, won't install."
50
+ Exit 1
51
+ }
52
+ '
53
+ # Install
54
+ - |
55
+ powershell '
56
+ $msi_path = (Join-Path "{{.TEMP_DIR}}" "{{.MSI}}")
57
+ Write-Output "Running installer"
58
+ $log_path = (Join-Path "{{.TEMP_DIR}}" "msiexec.log")
59
+ Start-Process -FilePath "msiexec.exe" -Wait -ArgumentList "/i $msi_path /passive /l*v $log_path"
60
+ '
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
5
+ install :
6
+ silent : true
7
+ vars :
8
+ URL : https://github.com/google/yamlfmt/releases/download/v0.9.0/yamlfmt_0.9.0_Windows_x86_64.tar.gz
9
+ EXE_NAME : yamlfmt.exe
10
+ TEMP_DIR :
11
+ sh : |
12
+ powershell '
13
+ $parent = [System.IO.Path]::GetTempPath()
14
+ $name = [System.IO.Path]::GetRandomFileName()
15
+ $path = (Join-Path $parent $name)
16
+ mkdir $path | Out-Null
17
+ Write-Output $path
18
+ '
19
+ cmds :
20
+ - defer : |
21
+ powershell '
22
+ Remove-Item -Recurse {{.TEMP_DIR}}
23
+ '
24
+ - |
25
+ powershell '
26
+ pushd {{.TEMP_DIR}}
27
+ echo "Downloading file from {{.URL}}"
28
+ $ProgressPreference = "SilentlyContinue"
29
+ curl -o tool.tar.gz "{{.URL}}"
30
+ echo "Unarchiving"
31
+ tar -xvzf tool.tar.gz
32
+ "Moving to ${HOME}/tools"
33
+ Move-Item -Force {{.EXE_NAME}} ${HOME}/tools
34
+ popd
35
+ '
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : " 3"
3
+
4
+ tasks :
You can’t perform that action at this time.
0 commit comments