Skip to content

Commit 978c812

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

File tree

6 files changed

+22
-57
lines changed

6 files changed

+22
-57
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-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
run: |
8989
openssl dgst -sha256 -r -out ${ARTIFACT}.sha256 \
9090
${ARTIFACT}
91-
- name: verify sha256
91+
- name: Verify sha256
9292
run: sha256sum -c ${ARTIFACT}.sha256
9393
- name: Upload artifacts
9494
uses: actions/upload-artifact@v4

.github/workflows/make-plugin-mac-os.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Make MacOS Plugin
1+
name: Make macOS Plugin
22

33
on:
44
push:
@@ -58,7 +58,7 @@ jobs:
5858
- name: Install Bazelisk (Bazel)
5959
run: |
6060
brew update
61-
brew install bazelisk coreutils
61+
brew install bazelisk
6262
bazelisk version
6363
- name: Build protoc-gen-grpc-web with Bazel
6464
run: |
@@ -71,7 +71,7 @@ jobs:
7171
run: |
7272
openssl dgst -sha256 -r -out ${ARTIFACT}.sha256 \
7373
${ARTIFACT}
74-
- name: verify sha256
74+
- name: Verify sha256
7575
run: shasum -a 256 -c ${ARTIFACT}.sha256
7676
- name: Upload artifacts
7777
uses: actions/upload-artifact@v4

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

Lines changed: 12 additions & 19 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: |
@@ -85,7 +78,7 @@ jobs:
8578
run: |
8679
openssl dgst -sha256 -r -out "${ARTIFACT}.sha256" "${ARTIFACT}"
8780
shell: bash
88-
- name: verify sha256
81+
- name: Verify sha256
8982
shell: powershell
9083
run: |
9184
$shaFile = "${env:ARTIFACT}.sha256"

0 commit comments

Comments
 (0)