Skip to content

Commit 454e11b

Browse files
python multi line issus
1 parent 43f32f6 commit 454e11b

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

.github/workflows/release.yaml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
path: |
3333
"~/.cache/bazel"
34-
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', '**/*.cpp', '**/*.h', '**/*.rs') }}
34+
key: "bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', '**/*.cpp', '**/*.h', '**/*.rs') }}"
3535
restore-keys: bazel-cache-
3636
- uses: bazelbuild/setup-bazelisk@v2
3737
- name: Test lib
@@ -68,7 +68,7 @@ jobs:
6868
with:
6969
path: |
7070
"~/.cache/bazel"
71-
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', '**/*.cpp', '**/*.h', '**/*.rs') }}
71+
key: "bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', '**/*.cpp', '**/*.h', '**/*.rs') }}"
7272
restore-keys: bazel-cache-
7373
- uses: bazelbuild/setup-bazelisk@v2
7474
- name: Build npm package
@@ -112,7 +112,7 @@ jobs:
112112
with:
113113
path: |
114114
"~/.cache/bazel"
115-
key: bazel-cache-${{ matrix.os }}-py${{ matrix.python-version }}
115+
key: "bazel-cache-${{ matrix.os }}-py${{ matrix.python-version }}"
116116
- uses: bazelbuild/setup-bazelisk@v2
117117
- name: Build wheel
118118
run: |
@@ -123,17 +123,24 @@ jobs:
123123
WHEEL_FILE="rtbot.whl"
124124
if [ -f "$WHEEL_FILE" ]; then
125125
# Extract version from wheel metadata
126-
VERSION=$(python -c "
127-
import zipfile, re
128-
with zipfile.ZipFile('$WHEEL_FILE', 'r') as z:
126+
export WHEEL_FILE="rtbot.whl"
127+
VERSION=$(python - <<'EOF'
128+
import os, zipfile
129+
130+
wheel = os.environ["WHEEL_FILE"]
131+
with zipfile.ZipFile(wheel, 'r') as z:
129132
for name in z.namelist():
130133
if '.dist-info/METADATA' in name:
131-
# Extract version from rtbot-VERSION.dist-info/METADATA
132134
dist_info_dir = name.split('/')[0]
133-
version = dist_info_dir.replace('rtbot-', '').replace('.dist-info', '')
134-
print(version)
135+
print(
136+
dist_info_dir
137+
.replace('rtbot-', '')
138+
.replace('.dist-info', '')
139+
)
135140
break
136-
")
141+
EOF
142+
)
143+
137144
# Determine platform tag
138145
if [ "${{ runner.os }}" = "Linux" ]; then
139146
PLATFORM="manylinux2014_x86_64"

0 commit comments

Comments
 (0)