diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0545efd..23fd045 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13ee1a3..df78a0a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: | diff --git a/README.md b/README.md index c875018..62cb3c2 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/doc/template.README.md b/doc/template.README.md index 10145c9..423fc62 100644 --- a/doc/template.README.md +++ b/doc/template.README.md @@ -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` diff --git a/release/.cache/.gitignore b/release/.cache/.gitignore index 7986d11..d6b7ef3 100644 --- a/release/.cache/.gitignore +++ b/release/.cache/.gitignore @@ -1 +1,2 @@ -#dummy +* +!.gitignore diff --git a/release/.gitignore b/release/.gitignore index 1354028..4adacd1 100644 --- a/release/.gitignore +++ b/release/.gitignore @@ -1,4 +1,3 @@ tmp generated.Dockerfile -.cache new.versions.txt diff --git a/release/10-ensure-protoc-binaries-exist.sh b/release/10-ensure-protoc-binaries-exist.sh new file mode 100755 index 0000000..1140059 --- /dev/null +++ b/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 diff --git a/release/10-get-protoc-binaries.sh b/release/10.1-get-protoc-binaries.sh similarity index 97% rename from release/10-get-protoc-binaries.sh rename to release/10.1-get-protoc-binaries.sh index d0a0f07..84693b4 100755 --- a/release/10-get-protoc-binaries.sh +++ b/release/10.1-get-protoc-binaries.sh @@ -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" diff --git a/release/source.sh b/release/source.sh index 73a1ca3..73ad4d5 100755 --- a/release/source.sh +++ b/release/source.sh @@ -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/")" diff --git a/test/results/.gitignore b/test/results/.gitignore index bee10d6..f4d523b 100644 --- a/test/results/.gitignore +++ b/test/results/.gitignore @@ -1 +1,3 @@ -*-out.txt \ No newline at end of file +*-out.txt +*-tmp.txt + diff --git a/test/suite/.gitignore b/test/suite/.gitignore index ec88124..2f1900f 100644 --- a/test/suite/.gitignore +++ b/test/suite/.gitignore @@ -1,3 +1,2 @@ run-testcases.sh tmp.Dockerfile -results/*-tmp.txt