Skip to content

Commit 6d05c71

Browse files
committed
FIX - refactor(build): update architecture detection for Windows plugin to use PowerShell
1 parent 36b5e29 commit 6d05c71

File tree

4 files changed

+17
-52
lines changed

4 files changed

+17
-52
lines changed

.bazelrc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ build --host_copt=-Wno-error=deprecated-declarations
55
# Required until this is the default; expected in Bazel 7
66
common --enable_bzlmod
77

8-
# Load any settings specific to the current user.
9-
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
10-
# This needs to be last statement in this
11-
# config, as the user configuration should be able to overwrite flags from this file.
12-
# See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
13-
# (Note that we use .bazelrc.user so the file appears next to .bazelrc in directory listing,
14-
# rather than user.bazelrc as suggested in the Bazel docs)
8+
# Per-user settings (gitignored). Keep last so local flags can override.
9+
# Docs: https://bazel.build/configure/best-practices#bazelrc
1510
try-import %workspace%/.bazelrc.user
16-

.bazelrc.windows

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ build --host_copt=-DABSL_HAVE_WORKING_GCC_WNO_DEPRECATED_DECLARATIONS=0
77

88
# Required until this is the default; expected in Bazel 7
99
common --enable_bzlmod
10+
11+
# Per-user settings (gitignored). Keep last so local flags can override.
12+
# Docs: https://bazel.build/configure/best-practices#bazelrc
13+
try-import %workspace%/.bazelrc.user

.github/workflows/make-plugin-arm.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/make-plugin-windows.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,18 @@ jobs:
3838
shell: bash
3939
- name: Compute ARCH suffix and artifact name
4040
id: meta
41+
shell: powershell
4142
run: |
42-
ARCH=$(uname -m)
43-
case "$ARCH" in
44-
arm64|aarch64)
45-
ARCH_SUFFIX="aarch64"
46-
;;
47-
x86_64|amd64|AMD64)
48-
ARCH_SUFFIX="x86_64"
49-
;;
50-
*)
51-
echo "Unsupported architecture: $ARCH" >&2
52-
exit 1
53-
;;
54-
esac
55-
ARTIFACT="protoc-gen-grpc-web-${VERSION_NUMBER}-windows-${ARCH_SUFFIX}.exe"
56-
echo "ARTIFACT=$ARTIFACT" >> "$GITHUB_ENV"
57-
echo "artifact=$ARTIFACT" >> "$GITHUB_OUTPUT"
58-
echo "Will produce artifact: $ARTIFACT"
59-
shell: bash
43+
$arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
44+
switch ($arch) {
45+
'Arm64' { $archSuffix = 'aarch64' }
46+
'X64' { $archSuffix = 'x86_64' }
47+
default { Write-Error "Unsupported architecture: $arch"; exit 1 }
48+
}
49+
$artifact = "protoc-gen-grpc-web-$($env:VERSION_NUMBER)-windows-$archSuffix.exe"
50+
"ARTIFACT=$artifact" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
51+
"artifact=$artifact" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
52+
Write-Host "Will produce artifact: $artifact"
6053
- name: Install Bazelisk (Bazel)
6154
shell: powershell
6255
run: |

0 commit comments

Comments
 (0)