From 5e9a3ca738b7c9e6b0a875747abfff404342e3ab Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 11:14:04 -0700 Subject: [PATCH 01/16] Add grpc-tools build GitHub Workflow --- .github/workflows/grpc-tools-build.yml | 66 ++++++++++++++++++++++++++ packages/grpc-tools/build_binaries.ps1 | 2 +- packages/grpc-tools/build_binaries.sh | 4 +- 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/grpc-tools-build.yml diff --git a/.github/workflows/grpc-tools-build.yml b/.github/workflows/grpc-tools-build.yml new file mode 100644 index 00000000..1e21cad7 --- /dev/null +++ b/.github/workflows/grpc-tools-build.yml @@ -0,0 +1,66 @@ +name: grpc-tools Build + +on: + push: + branches: + - master + pull-request: + branches: + - master + +jobs: + linux_build: + name: Linux grpc-tools Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Build + run: | + docker build -t kokoro-native-image tools/release/native + docker run -v /var/run/docker.sock:/var/run/docker.sock -v $GITHUB_WORKSPACE:$GITHUB_WORKSPACE kokoro-native-image $GITHUB_WORKSPACE/packages/grpc-tools/build_binaries.sh + - uses: actions/upload-artifact@v2 + with: + name: grpc-tools_linux + path: artifacts/ + macos_build: + name: Macos grpc-tools Build + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Build + run: packages/grpc-tools/build_binaries.sh + - uses: actions/upload-artifact@v2 + with: + name: grpc-tools_macos + path: artifacts/ + windows_build: + name: Windows grpc-tools Build + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Build + run: packages/grpc-tools/build_binaries.ps1 + - uses: actions/upload-artifact@v2 + with: + name: grpc-tools_windows + path: artifacts/ + combine_artifacts: + name: Combine grpc-tools artifacts + runs-on: ubuntu-latest + needs: [linux_build, macos_build, windows_build] + steps: + - uses: actions/download-artifact@v2 + - name: Copy + run: | + mkdir artifacts + cp -r ./**/* artifacts/ + - uses: actions/upload-artifact@v2 + with: + name: combined-artifacts + path: artifacts/ diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index 8c249642..139485c1 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -37,7 +37,7 @@ MkDir-p ($Base + "/build/bin") $PackageFile = $Base + "/package.json" $ToolsVersion = ((Get-Content $PackageFile) -join "`n" | ConvertFrom-Json).version -$OutDir = $Env:ARTIFACTS_OUT + "/grpc-tools/v" + $ToolsVersion +$OutDir = $Base + "/../../artifacts/grpc-tools/v" + $ToolsVersion Mkdir-p $OutDir $ArchList = "ia32","x64" diff --git a/packages/grpc-tools/build_binaries.sh b/packages/grpc-tools/build_binaries.sh index 2a442183..b26946af 100755 --- a/packages/grpc-tools/build_binaries.sh +++ b/packages/grpc-tools/build_binaries.sh @@ -23,8 +23,8 @@ protobuf_base=$base/deps/protobuf tools_version=$(jq '.version' < package.json | tr -d '"') -# Note: $ARTIFACTS_OUT should not be in this directory -out_dir=$ARTIFACTS_OUT/grpc-tools/v$tools_version +# Note: artifacts should not be output in the package directory +out_dir=$base/../../artifacts/grpc-tools/v$tools_version mkdir -p "$out_dir" case $(uname -s) in From 8dd73f4635c58f8a0419a566c1c565e64f4bea14 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 11:18:45 -0700 Subject: [PATCH 02/16] Remove kokoro build scripts and configs --- test/kokoro-nodejs-build-test.bat | 23 ------------- test/kokoro-nodejs-build-test.sh | 20 ----------- test/kokoro/linux-build-nodejs.cfg | 19 ----------- test/kokoro/macos-build-nodejs.cfg | 19 ----------- test/kokoro/windows-build-nodejs.cfg | 19 ----------- tools/release/kokoro-grpc-tools.bat | 27 --------------- tools/release/kokoro-grpc-tools.sh | 37 --------------------- tools/release/kokoro/linux-grpc-tools.cfg | 25 -------------- tools/release/kokoro/macos-grpc-tools.cfg | 25 -------------- tools/release/kokoro/windows-grpc-tools.cfg | 25 -------------- 10 files changed, 239 deletions(-) delete mode 100644 test/kokoro-nodejs-build-test.bat delete mode 100755 test/kokoro-nodejs-build-test.sh delete mode 100644 test/kokoro/linux-build-nodejs.cfg delete mode 100644 test/kokoro/macos-build-nodejs.cfg delete mode 100644 test/kokoro/windows-build-nodejs.cfg delete mode 100644 tools/release/kokoro-grpc-tools.bat delete mode 100755 tools/release/kokoro-grpc-tools.sh delete mode 100644 tools/release/kokoro/linux-grpc-tools.cfg delete mode 100644 tools/release/kokoro/macos-grpc-tools.cfg delete mode 100644 tools/release/kokoro/windows-grpc-tools.cfg diff --git a/test/kokoro-nodejs-build-test.bat b/test/kokoro-nodejs-build-test.bat deleted file mode 100644 index ea45c3f8..00000000 --- a/test/kokoro-nodejs-build-test.bat +++ /dev/null @@ -1,23 +0,0 @@ -@rem Copyright 2019 gRPC authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. - -cd /d %~dp0 -cd .. - -call ./tools/release/kokoro-grpc-tools.bat || goto :error - -goto :EOF - -:error -exit /b 1 \ No newline at end of file diff --git a/test/kokoro-nodejs-build-test.sh b/test/kokoro-nodejs-build-test.sh deleted file mode 100755 index d3b2a546..00000000 --- a/test/kokoro-nodejs-build-test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Copyright 2019 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e -cd $(dirname $0)/.. -base_dir=$(pwd) - -./tools/release/kokoro-grpc-tools.sh \ No newline at end of file diff --git a/test/kokoro/linux-build-nodejs.cfg b/test/kokoro/linux-build-nodejs.cfg deleted file mode 100644 index ba2f49f2..00000000 --- a/test/kokoro/linux-build-nodejs.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2018 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for Kokoro (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc-node/test/kokoro-nodejs-build-test.sh" -timeout_mins: 60 diff --git a/test/kokoro/macos-build-nodejs.cfg b/test/kokoro/macos-build-nodejs.cfg deleted file mode 100644 index ba2f49f2..00000000 --- a/test/kokoro/macos-build-nodejs.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2018 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for Kokoro (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc-node/test/kokoro-nodejs-build-test.sh" -timeout_mins: 60 diff --git a/test/kokoro/windows-build-nodejs.cfg b/test/kokoro/windows-build-nodejs.cfg deleted file mode 100644 index 87f44370..00000000 --- a/test/kokoro/windows-build-nodejs.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2018 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for Kokoro (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc-node/test/kokoro-nodejs-build-test.bat" -timeout_mins: 60 diff --git a/tools/release/kokoro-grpc-tools.bat b/tools/release/kokoro-grpc-tools.bat deleted file mode 100644 index 6b1e2fb4..00000000 --- a/tools/release/kokoro-grpc-tools.bat +++ /dev/null @@ -1,27 +0,0 @@ -@rem Copyright 2019 gRPC authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. - -cd /d %~dp0 -cd ../.. - -git submodule update --init --recursive - -@rem make sure msys binaries are preferred over cygwin binaries -set PATH=C:\tools\msys64\usr\bin;%PATH% -set ARTIFACTS_OUT=%cd%/artifacts -powershell -File ./packages/grpc-tools/build_binaries.ps1 || goto :error -goto :EOF - -:error -exit /b 1 \ No newline at end of file diff --git a/tools/release/kokoro-grpc-tools.sh b/tools/release/kokoro-grpc-tools.sh deleted file mode 100755 index 267d6cc2..00000000 --- a/tools/release/kokoro-grpc-tools.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Copyright 2019 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Deleting Ruby. -rm -rf ~/.rvm - -set -e -cd $(dirname $0)/../.. -base_dir=$(pwd) - -OS=$(uname) - -git submodule update --init --recursive - -uname -a - -case $OS in -Linux) - docker build -t kokoro-native-image tools/release/native - docker run -v /var/run/docker.sock:/var/run/docker.sock -v $base_dir:$base_dir -e ARTIFACTS_OUT=$base_dir/artifacts kokoro-native-image $base_dir/packages/grpc-tools/build_binaries.sh - ;; -Darwin) - ARTIFACTS_OUT=$base_dir/artifacts ./packages/grpc-tools/build_binaries.sh - ;; -esac \ No newline at end of file diff --git a/tools/release/kokoro/linux-grpc-tools.cfg b/tools/release/kokoro/linux-grpc-tools.cfg deleted file mode 100644 index 0925db77..00000000 --- a/tools/release/kokoro/linux-grpc-tools.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2019 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for Kokoro (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc-node/tools/release/kokoro-grpc-tools.sh" -timeout_mins: 60 -action { - define_artifacts { - regex: "github/grpc-node/artifacts/**", - strip_prefix: "github/grpc-node/artifacts" - } -} diff --git a/tools/release/kokoro/macos-grpc-tools.cfg b/tools/release/kokoro/macos-grpc-tools.cfg deleted file mode 100644 index 0925db77..00000000 --- a/tools/release/kokoro/macos-grpc-tools.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2019 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for Kokoro (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc-node/tools/release/kokoro-grpc-tools.sh" -timeout_mins: 60 -action { - define_artifacts { - regex: "github/grpc-node/artifacts/**", - strip_prefix: "github/grpc-node/artifacts" - } -} diff --git a/tools/release/kokoro/windows-grpc-tools.cfg b/tools/release/kokoro/windows-grpc-tools.cfg deleted file mode 100644 index db649afc..00000000 --- a/tools/release/kokoro/windows-grpc-tools.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2019 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for Kokoro (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc-node/tools/release/kokoro-grpc-tools.bat" -timeout_mins: 60 -action { - define_artifacts { - regex: "github/grpc-node/artifacts/**", - strip_prefix: "github/grpc-node/artifacts" - } -} From f7617255566f8c4cbce6f77315a265c9dd89f248 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 11:24:20 -0700 Subject: [PATCH 03/16] My VSCode plugin autocompletes upload-artifact and download-artifact to v1 --- .github/workflows/grpc-tools-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/grpc-tools-build.yml b/.github/workflows/grpc-tools-build.yml index 1e21cad7..ac4b5a43 100644 --- a/.github/workflows/grpc-tools-build.yml +++ b/.github/workflows/grpc-tools-build.yml @@ -20,7 +20,7 @@ jobs: run: | docker build -t kokoro-native-image tools/release/native docker run -v /var/run/docker.sock:/var/run/docker.sock -v $GITHUB_WORKSPACE:$GITHUB_WORKSPACE kokoro-native-image $GITHUB_WORKSPACE/packages/grpc-tools/build_binaries.sh - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v1 with: name: grpc-tools_linux path: artifacts/ @@ -33,7 +33,7 @@ jobs: submodules: recursive - name: Build run: packages/grpc-tools/build_binaries.sh - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v1 with: name: grpc-tools_macos path: artifacts/ @@ -46,7 +46,7 @@ jobs: submodules: recursive - name: Build run: packages/grpc-tools/build_binaries.ps1 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v1 with: name: grpc-tools_windows path: artifacts/ @@ -55,12 +55,12 @@ jobs: runs-on: ubuntu-latest needs: [linux_build, macos_build, windows_build] steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v1 - name: Copy run: | mkdir artifacts cp -r ./**/* artifacts/ - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v1 with: name: combined-artifacts path: artifacts/ From 22bce28eede8174f82cf64593b5c8c8b8bbe563b Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 11:34:38 -0700 Subject: [PATCH 04/16] Fix trigger condition typo --- .github/workflows/grpc-tools-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/grpc-tools-build.yml b/.github/workflows/grpc-tools-build.yml index ac4b5a43..ffcf5b9c 100644 --- a/.github/workflows/grpc-tools-build.yml +++ b/.github/workflows/grpc-tools-build.yml @@ -4,7 +4,7 @@ on: push: branches: - master - pull-request: + pull_request: branches: - master From 95e49dc6841cd6ba115151bf8d6bd2afe8eeedbe Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Tue, 12 May 2020 14:52:01 -0700 Subject: [PATCH 05/16] Fix package installation in grpc-tools build script --- packages/grpc-tools/build_binaries.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index 139485c1..38a2dcfd 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -16,6 +16,10 @@ $ErrorActionPreference = "Stop" +<# https://stackoverflow.com/questions/16657778/install-nuget-via-powershell-script/26421187#comment107976901_48216538 #> + +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls11,Tls12' + Install-PackageProvider -Name NuGet -RequiredVersion 2.8.5.201 -Force Import-PackageProvider -Name NuGet -RequiredVersion 2.8.5.201 Install-Module -Force -Name 7Zip4Powershell From de9d8959b1bd33437fea88add9475ba586fb7bf5 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 12:02:55 -0700 Subject: [PATCH 06/16] Make PowerShell actually output something of some value --- packages/grpc-tools/build_binaries.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index 38a2dcfd..d03b64a4 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -14,6 +14,8 @@ limitations under the License. #> +Set-PSDebug -trace 2 + $ErrorActionPreference = "Stop" <# https://stackoverflow.com/questions/16657778/install-nuget-via-powershell-script/26421187#comment107976901_48216538 #> From 83590e20b6dacd2242ed9350488ed893cfcda486 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 13:04:59 -0700 Subject: [PATCH 07/16] Test PowerShell output --- packages/grpc-tools/build_binaries.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index d03b64a4..81e27e2d 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -16,6 +16,8 @@ Set-PSDebug -trace 2 +Write-Host "Hello World" + $ErrorActionPreference = "Stop" <# https://stackoverflow.com/questions/16657778/install-nuget-via-powershell-script/26421187#comment107976901_48216538 #> From de5063d4b1924059f1a11c899033e822f7f7b81b Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 13:09:50 -0700 Subject: [PATCH 08/16] Call the powershell script through cmd --- .github/workflows/grpc-tools-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/grpc-tools-build.yml b/.github/workflows/grpc-tools-build.yml index ffcf5b9c..b419744c 100644 --- a/.github/workflows/grpc-tools-build.yml +++ b/.github/workflows/grpc-tools-build.yml @@ -45,7 +45,8 @@ jobs: with: submodules: recursive - name: Build - run: packages/grpc-tools/build_binaries.ps1 + run: powershell -File ./packages/grpc-tools/build_binaries.ps1 + shell: cmd - uses: actions/upload-artifact@v1 with: name: grpc-tools_windows From 2677d8773c68d7e3083eb7cc5a30583bf4bc3a79 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 13:21:34 -0700 Subject: [PATCH 09/16] Change how artifacts directory path is written, remove debug output --- packages/grpc-tools/build_binaries.ps1 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index 81e27e2d..a44d2971 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -14,10 +14,6 @@ limitations under the License. #> -Set-PSDebug -trace 2 - -Write-Host "Hello World" - $ErrorActionPreference = "Stop" <# https://stackoverflow.com/questions/16657778/install-nuget-via-powershell-script/26421187#comment107976901_48216538 #> @@ -45,9 +41,12 @@ MkDir-p ($Base + "/build/bin") $PackageFile = $Base + "/package.json" $ToolsVersion = ((Get-Content $PackageFile) -join "`n" | ConvertFrom-Json).version -$OutDir = $Base + "/../../artifacts/grpc-tools/v" + $ToolsVersion +cd ../.. +$OutDir = $pwd + "/artifacts/grpc-tools/v" + $ToolsVersion Mkdir-p $OutDir +cd $Base + $ArchList = "ia32","x64" foreach ($Arch in $ArchList) { From edecb1994b4f6a7a68a9511f8131305346e2196b Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 13:31:08 -0700 Subject: [PATCH 10/16] Add other debug output --- packages/grpc-tools/build_binaries.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index a44d2971..90e2070d 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -39,6 +39,8 @@ $ProtobufBase = $Base + "/deps/protobuf" MkDir-p ($Base + "/build/bin") $PackageFile = $Base + "/package.json" +Write-Host $PackageFile +Write-Host (Get-Content $PackageFile) -join "`n" $ToolsVersion = ((Get-Content $PackageFile) -join "`n" | ConvertFrom-Json).version cd ../.. From a59934ffa6b2d21fb30473691e19d0c5564230d7 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 13:34:08 -0700 Subject: [PATCH 11/16] Add more debug output --- packages/grpc-tools/build_binaries.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index 90e2070d..407a7043 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -42,6 +42,7 @@ $PackageFile = $Base + "/package.json" Write-Host $PackageFile Write-Host (Get-Content $PackageFile) -join "`n" $ToolsVersion = ((Get-Content $PackageFile) -join "`n" | ConvertFrom-Json).version +Write-Host $ToolsVersion cd ../.. $OutDir = $pwd + "/artifacts/grpc-tools/v" + $ToolsVersion From a1807ce67a81176e81eda9029ae9393b577b4e85 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 13:37:07 -0700 Subject: [PATCH 12/16] Fix use of --- packages/grpc-tools/build_binaries.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index 407a7043..7f4859c8 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -39,13 +39,10 @@ $ProtobufBase = $Base + "/deps/protobuf" MkDir-p ($Base + "/build/bin") $PackageFile = $Base + "/package.json" -Write-Host $PackageFile -Write-Host (Get-Content $PackageFile) -join "`n" $ToolsVersion = ((Get-Content $PackageFile) -join "`n" | ConvertFrom-Json).version -Write-Host $ToolsVersion cd ../.. -$OutDir = $pwd + "/artifacts/grpc-tools/v" + $ToolsVersion +$OutDir = $pwd.Path + "/artifacts/grpc-tools/v" + $ToolsVersion Mkdir-p $OutDir cd $Base From 5184050d97c4def77dad7500d6700493d34d5555 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Thu, 14 May 2020 14:08:04 -0700 Subject: [PATCH 13/16] Add command tracing again --- packages/grpc-tools/build_binaries.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index 7f4859c8..5cc5e45b 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -47,6 +47,8 @@ Mkdir-p $OutDir cd $Base +Set-PSDebug -trace 2 + $ArchList = "ia32","x64" foreach ($Arch in $ArchList) { From 9b82abae06ff51f8b9b034d323b92be204838846 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Fri, 15 May 2020 10:07:45 -0700 Subject: [PATCH 14/16] Set arch properly, clean build products differently --- packages/grpc-tools/build_binaries.ps1 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index 5cc5e45b..bec4f1ac 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -53,12 +53,12 @@ $ArchList = "ia32","x64" foreach ($Arch in $ArchList) { if ($Arch -eq "x64") { - $Generator = "Visual Studio 14 2015 Win64" + $ArchName = "x64" } else { - $Generator = "Visual Studio 14 2015" + $ArchName = "Win32" } - & cmake.exe . + & cmake.exe . -A $ArchName if ($LASTEXITCODE -ne 0) { throw "cmake failed" } @@ -73,7 +73,5 @@ foreach ($Arch in $ArchList) { Compress-7Zip -Path ($Base + "/build") -Format Tar -ArchiveFileName ($Base + "/Archive.tar") Compress-7Zip -Path ($Base + "/Archive.tar") -Format GZip -ArchiveFileName ($OutDir + "/win32-" + $Arch + ".tar.gz") - Remove-Item ($Base + "/build/bin/protoc.exe") - Remove-Item ($Base + "/build/bin/grpc_node_plugin.exe") - Remove-Item ($Base + "/CMakeCache.txt") + & git clean -xdf . } \ No newline at end of file From 4c6847fc9fde4a37526bada59fd4cc23b0e94edb Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Fri, 15 May 2020 10:38:54 -0700 Subject: [PATCH 15/16] Build Windows x86 and x64 separately using a matrix --- .github/workflows/grpc-tools-build.yml | 7 ++++- packages/grpc-tools/build_binaries.ps1 | 40 ++++++++++++-------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/grpc-tools-build.yml b/.github/workflows/grpc-tools-build.yml index b419744c..4f84143a 100644 --- a/.github/workflows/grpc-tools-build.yml +++ b/.github/workflows/grpc-tools-build.yml @@ -40,6 +40,11 @@ jobs: windows_build: name: Windows grpc-tools Build runs-on: windows-latest + strategy: + matrix: + arch: [ia32, x64] + env: + ARCH: ${{matrix.arch}} steps: - uses: actions/checkout@v2 with: @@ -49,7 +54,7 @@ jobs: shell: cmd - uses: actions/upload-artifact@v1 with: - name: grpc-tools_windows + name: grpc-tools_windows_${{matrix.arch}} path: artifacts/ combine_artifacts: name: Combine grpc-tools artifacts diff --git a/packages/grpc-tools/build_binaries.ps1 b/packages/grpc-tools/build_binaries.ps1 index bec4f1ac..629aea26 100644 --- a/packages/grpc-tools/build_binaries.ps1 +++ b/packages/grpc-tools/build_binaries.ps1 @@ -49,29 +49,27 @@ cd $Base Set-PSDebug -trace 2 -$ArchList = "ia32","x64" +$Arch = $Env:ARCH -foreach ($Arch in $ArchList) { - if ($Arch -eq "x64") { - $ArchName = "x64" - } else { - $ArchName = "Win32" - } +if ($Arch -eq "x64") { + $ArchName = "x64" +} else { + $ArchName = "Win32" +} - & cmake.exe . -A $ArchName - if ($LASTEXITCODE -ne 0) { - throw "cmake failed" - } - & cmake.exe --build . - if ($LASTEXITCODE -ne 0) { - throw "cmake build failed" - } +& cmake.exe . -A $ArchName +if ($LASTEXITCODE -ne 0) { + throw "cmake failed" +} +& cmake.exe --build . +if ($LASTEXITCODE -ne 0) { + throw "cmake build failed" +} - Copy-Item ($ProtobufBase + "/Debug/protoc.exe") -Destination ($Base + "/build/bin/protoc.exe") - Copy-Item ($Base + "/Debug/grpc_node_plugin.exe") -Destination ($Base + "/build/bin/grpc_node_plugin.exe") +Copy-Item ($ProtobufBase + "/Debug/protoc.exe") -Destination ($Base + "/build/bin/protoc.exe") +Copy-Item ($Base + "/Debug/grpc_node_plugin.exe") -Destination ($Base + "/build/bin/grpc_node_plugin.exe") - Compress-7Zip -Path ($Base + "/build") -Format Tar -ArchiveFileName ($Base + "/Archive.tar") - Compress-7Zip -Path ($Base + "/Archive.tar") -Format GZip -ArchiveFileName ($OutDir + "/win32-" + $Arch + ".tar.gz") +Compress-7Zip -Path ($Base + "/build") -Format Tar -ArchiveFileName ($Base + "/Archive.tar") +Compress-7Zip -Path ($Base + "/Archive.tar") -Format GZip -ArchiveFileName ($OutDir + "/win32-" + $Arch + ".tar.gz") - & git clean -xdf . -} \ No newline at end of file +& git clean -xdf . \ No newline at end of file From e9fad90d5367c2b047d97e3d5cdb6ea414fb0b48 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Fri, 15 May 2020 11:03:18 -0700 Subject: [PATCH 16/16] Switch back to upload- and download-artifacts v2 --- .github/workflows/grpc-tools-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/grpc-tools-build.yml b/.github/workflows/grpc-tools-build.yml index 4f84143a..f32a688c 100644 --- a/.github/workflows/grpc-tools-build.yml +++ b/.github/workflows/grpc-tools-build.yml @@ -20,7 +20,7 @@ jobs: run: | docker build -t kokoro-native-image tools/release/native docker run -v /var/run/docker.sock:/var/run/docker.sock -v $GITHUB_WORKSPACE:$GITHUB_WORKSPACE kokoro-native-image $GITHUB_WORKSPACE/packages/grpc-tools/build_binaries.sh - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v2 with: name: grpc-tools_linux path: artifacts/ @@ -33,7 +33,7 @@ jobs: submodules: recursive - name: Build run: packages/grpc-tools/build_binaries.sh - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v2 with: name: grpc-tools_macos path: artifacts/ @@ -61,12 +61,12 @@ jobs: runs-on: ubuntu-latest needs: [linux_build, macos_build, windows_build] steps: - - uses: actions/download-artifact@v1 + - uses: actions/download-artifact@v2 - name: Copy run: | mkdir artifacts cp -r ./**/* artifacts/ - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v2 with: name: combined-artifacts path: artifacts/