Skip to content

Commit 0152b3b

Browse files
committed
[dev] Automatically download protoc binaries. Cleanup.
1 parent 3464624 commit 0152b3b

File tree

11 files changed

+24
-14
lines changed

11 files changed

+24
-14
lines changed

Diff for: .github/workflows/release.yml

-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ jobs:
3535
set +x
3636
source release/source.sh
3737
38-
- name: Protoc
39-
run: |
40-
./release/10-get-protoc-binaries.sh
41-
4238
- name: Install Go and Goreleaser
4339
run: |
4440
sudo apt-get -q update

Diff for: .github/workflows/test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
sudo apt-get -q update
2020
sudo apt-get -q install -y jq zip unzip curl
2121
git fetch --tags origin
22-
./release/10-get-protoc-binaries.sh
2322
2423
- name: Tests
2524
run: |

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ How to make a release: [RELEASE.md](RELEASE.md)
207207
#### Setup
208208

209209
- As for script utilities, one needs `bash`, `jq`, `zip`, `unzip` and `curl`.
210-
- One also needs to download the protoc binaries for the local development via `release/10-get-protoc-binaries.sh`.
210+
211+
Running the tests will download the protoc binaries on the first invocation automatically.
211212

212213
For development the `generated-local.Dockerfile` (via [generate-local.Dockerfile.sh](dev/generate-local.Dockerfile.sh)) is used.
213214
To build the image simply run `source test/suite/setup.sh` and then `buildProtocurl`

Diff for: doc/template.README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ How to make a release: [RELEASE.md](RELEASE.md)
202202
#### Setup
203203

204204
- As for script utilities, one needs `bash`, `jq`, `zip`, `unzip` and `curl`.
205-
- One also needs to download the protoc binaries for the local development via `release/10-get-protoc-binaries.sh`.
205+
206+
Running the tests will download the protoc binaries on the first invocation automatically.
206207

207208
For development the `generated-local.Dockerfile` (via [generate-local.Dockerfile.sh](dev/generate-local.Dockerfile.sh)) is used.
208209
To build the image simply run `source test/suite/setup.sh` and then `buildProtocurl`

Diff for: release/.cache/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
#dummy
1+
*
2+
!.gitignore

Diff for: release/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
tmp
22
generated.Dockerfile
3-
.cache
43
new.versions.txt

Diff for: release/10-ensure-protoc-binaries-exist.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
source ./release/0-get-latest-dependencies-versions.sh
5+
6+
FILES_EXIST="true"
7+
ls release/tmp/protoc-$PROTO_VERSION-*.zip > /dev/null 2>&1 || FILES_EXIST="false"
8+
9+
if [[ "$FILES_EXIST" == "true" ]]; then
10+
echo "Found protoc binaries for $PROTO_VERSION."
11+
else
12+
echo "No protoc binaries for $PROTO_VERSION found. Downloading..."
13+
./release/10.1-get-protoc-binaries.sh
14+
fi

Diff for: release/10-get-protoc-binaries.sh renamed to release/10.1-get-protoc-binaries.sh

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
source release/source.sh
5-
64
# platforms and architectures for which Google released pre-built binaries
75
VARIATIONS=(
86
"linux-aarch_64"

Diff for: release/source.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -euo pipefail
33

44
# PRECONDITION: git fetch origin --tags
55

6-
source ./release/0-get-latest-dependencies-versions.sh
6+
source ./release/10-ensure-protoc-binaries-exist.sh
77

88
# should be one of 386, amd64 and arm64
99
export BUILD_ARCH="$(uname -m | sed "s/x86_64/amd64/" | sed "s/x86_32/386/" | sed "s/aarch_64/arm64/")"

Diff for: test/results/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*-out.txt
1+
*-out.txt
2+
*-tmp.txt
3+

Diff for: test/suite/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
run-testcases.sh
22
tmp.Dockerfile
3-
results/*-tmp.txt

0 commit comments

Comments
 (0)