Skip to content

Commit f3312e7

Browse files
committed
update shell query
1 parent 977f05c commit f3312e7

File tree

5 files changed

+15
-52
lines changed

5 files changed

+15
-52
lines changed

azure/build-prereqs.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@ parameters:
66
steps:
77
- bash: |
88
pyversion="3.13"
9-
PATCH=curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
10-
| jq -r --arg pyversion "$pyversion" '
11-
[ .[]
12-
| select(.stable == true)
13-
| .version
14-
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$"))
15-
| split(".") | map(tonumber)
16-
]
17-
| max
18-
| join(".")'
9+
PATCH=$(curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
10+
| jq -r --arg pyversion "$pyversion" '[ .[] | select(.stable == true) | .version
11+
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$")) | split(".") | map(tonumber)] | max | join(".")')
1912
2013
echo "##vso[task.setvariable variable=PY_VER]$PATCH"
2114
echo "Resolved latest python version: $PATCH"

azure/cleanup-ecs-pr-proxies.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,9 @@ jobs:
6262

6363
- bash: |
6464
pyversion="3.13"
65-
PATCH=curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
66-
| jq -r --arg pyversion "$pyversion" '
67-
[ .[]
68-
| select(.stable == true)
69-
| .version
70-
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$"))
71-
| split(".") | map(tonumber)
72-
]
73-
| max
74-
| join(".")'
75-
76-
echo "##vso[task.setvariable variable=PY_VER]$PATCH"
65+
PATCH=$(curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
66+
| jq -r --arg pyversion "$pyversion" '[ .[] | select(.stable == true) | .version
67+
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$")) | split(".") | map(tonumber)] | max | join(".")')
7768
echo "Resolved latest python version: $PATCH"
7869
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH;]/agent/_work/_tool/Python/${PATCH}/x64/lib/"
7970
displayName: 'Query and set python tool cache path'

azure/common/apigee-build.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,9 @@ jobs:
145145

146146
- bash: |
147147
pyversion=${{ parameters.python_version }}
148-
PATCH=curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
149-
| jq -r --arg pyversion "$pyversion" '
150-
[ .[]
151-
| select(.stable == true)
152-
| .version
153-
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$"))
154-
| split(".") | map(tonumber)
155-
]
156-
| max
157-
| join(".")'
148+
PATCH=$(curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
149+
| jq -r --arg pyversion "$pyversion" '[ .[] | select(.stable == true) | .version
150+
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$")) | split(".") | map(tonumber)] | max | join(".")')
158151
159152
echo "##vso[task.setvariable variable=PY_VER]$PATCH"
160153
echo "Resolved latest python version: $PATCH"

azure/common/deploy-stage.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,9 @@ stages:
126126

127127
- bash: |
128128
pyversion="3.13"
129-
PATCH=curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
130-
| jq -r --arg pyversion "$pyversion" '
131-
[ .[]
132-
| select(.stable == true)
133-
| .version
134-
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$"))
135-
| split(".") | map(tonumber)
136-
]
137-
| max
138-
| join(".")'
129+
PATCH=$(curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
130+
| jq -r --arg pyversion "$pyversion" '[ .[] | select(.stable == true) | .version
131+
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$")) | split(".") | map(tonumber)] | max | join(".")')
139132
140133
echo "##vso[task.setvariable variable=PY_VER]$PATCH"
141134
echo "Resolved latest python version: $PATCH"

azure/utils-pr-pipeline.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@ jobs:
3131
steps:
3232
- bash: |
3333
pyversion="3.13"
34-
PATCH=curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
35-
| jq -r --arg pyversion "$pyversion" '
36-
[ .[]
37-
| select(.stable == true)
38-
| .version
39-
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$"))
40-
| split(".") | map(tonumber)
41-
]
42-
| max
43-
| join(".")'
34+
PATCH=$(curl -fsSL https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json \
35+
| jq -r --arg pyversion "$pyversion" '[ .[] | select(.stable == true) | .version
36+
| select(test("^" + ($pyversion|gsub("\\.";"\\.")) + "\\.\\d+$")) | split(".") | map(tonumber)] | max | join(".")')
4437
4538
echo "##vso[task.setvariable variable=PY_VER]$PATCH"
4639
echo "Resolved latest python version: $PATCH"

0 commit comments

Comments
 (0)