Skip to content

Commit

Permalink
[dev] Automatically download protoc binaries. Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
GollyTicker committed Oct 16, 2023
1 parent 3464624 commit 0152b3b
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 14 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Expand Up @@ -35,10 +35,6 @@ jobs:
set +x
source release/source.sh
- name: Protoc
run: |
./release/10-get-protoc-binaries.sh
- name: Install Go and Goreleaser
run: |
sudo apt-get -q update
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -19,7 +19,6 @@ jobs:
sudo apt-get -q update
sudo apt-get -q install -y jq zip unzip curl
git fetch --tags origin
./release/10-get-protoc-binaries.sh
- name: Tests
run: |
Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -207,7 +207,8 @@ How to make a release: [RELEASE.md](RELEASE.md)
#### Setup

- As for script utilities, one needs `bash`, `jq`, `zip`, `unzip` and `curl`.
- One also needs to download the protoc binaries for the local development via `release/10-get-protoc-binaries.sh`.

Running the tests will download the protoc binaries on the first invocation automatically.

For development the `generated-local.Dockerfile` (via [generate-local.Dockerfile.sh](dev/generate-local.Dockerfile.sh)) is used.
To build the image simply run `source test/suite/setup.sh` and then `buildProtocurl`
Expand Down
3 changes: 2 additions & 1 deletion doc/template.README.md
Expand Up @@ -202,7 +202,8 @@ How to make a release: [RELEASE.md](RELEASE.md)
#### Setup

- As for script utilities, one needs `bash`, `jq`, `zip`, `unzip` and `curl`.
- One also needs to download the protoc binaries for the local development via `release/10-get-protoc-binaries.sh`.

Running the tests will download the protoc binaries on the first invocation automatically.

For development the `generated-local.Dockerfile` (via [generate-local.Dockerfile.sh](dev/generate-local.Dockerfile.sh)) is used.
To build the image simply run `source test/suite/setup.sh` and then `buildProtocurl`
Expand Down
3 changes: 2 additions & 1 deletion release/.cache/.gitignore
@@ -1 +1,2 @@
#dummy
*
!.gitignore
1 change: 0 additions & 1 deletion release/.gitignore
@@ -1,4 +1,3 @@
tmp
generated.Dockerfile
.cache
new.versions.txt
14 changes: 14 additions & 0 deletions release/10-ensure-protoc-binaries-exist.sh
@@ -0,0 +1,14 @@
#!/bin/bash
set -euo pipefail

source ./release/0-get-latest-dependencies-versions.sh

FILES_EXIST="true"
ls release/tmp/protoc-$PROTO_VERSION-*.zip > /dev/null 2>&1 || FILES_EXIST="false"

if [[ "$FILES_EXIST" == "true" ]]; then
echo "Found protoc binaries for $PROTO_VERSION."
else
echo "No protoc binaries for $PROTO_VERSION found. Downloading..."
./release/10.1-get-protoc-binaries.sh
fi
@@ -1,8 +1,6 @@
#!/bin/bash
set -euo pipefail

source release/source.sh

# platforms and architectures for which Google released pre-built binaries
VARIATIONS=(
"linux-aarch_64"
Expand Down
2 changes: 1 addition & 1 deletion release/source.sh
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

# PRECONDITION: git fetch origin --tags

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

# should be one of 386, amd64 and arm64
export BUILD_ARCH="$(uname -m | sed "s/x86_64/amd64/" | sed "s/x86_32/386/" | sed "s/aarch_64/arm64/")"
Expand Down
4 changes: 3 additions & 1 deletion test/results/.gitignore
@@ -1 +1,3 @@
*-out.txt
*-out.txt
*-tmp.txt

1 change: 0 additions & 1 deletion test/suite/.gitignore
@@ -1,3 +1,2 @@
run-testcases.sh
tmp.Dockerfile
results/*-tmp.txt

0 comments on commit 0152b3b

Please sign in to comment.