mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-29 14:37:05 +00:00
cache protoc
This commit is contained in:
@@ -45,19 +45,25 @@ jobs:
|
|||||||
uses: actions/setup-go@v7
|
uses: actions/setup-go@v7
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
- name: Install pinned protobuf tools
|
- name: Cache protoc
|
||||||
|
id: cache-protoc
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ${{ runner.temp }}/protoc
|
||||||
|
key: protoc-linux-x86_64-33.5
|
||||||
|
- name: Download protoc
|
||||||
|
if: steps.cache-protoc.outputs.cache-hit != 'true'
|
||||||
working-directory: ${{ runner.temp }}
|
working-directory: ${{ runner.temp }}
|
||||||
env:
|
|
||||||
GOBIN: ${{ runner.temp }}/protobuf/bin
|
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL --retry 3 -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v33.5/protoc-33.5-linux-x86_64.zip
|
curl -fsSL --retry 3 -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v33.5/protoc-33.5-linux-x86_64.zip
|
||||||
unzip -q protoc.zip -d protobuf
|
unzip -q protoc.zip -d protoc
|
||||||
|
- name: Install pinned protobuf tools
|
||||||
|
run: |
|
||||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.11
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.11
|
||||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.6.0
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.6.0
|
||||||
echo "GOBIN=$GOBIN" >> "$GITHUB_ENV"
|
|
||||||
echo "$GOBIN" >> "$GITHUB_PATH"
|
|
||||||
- name: Check generated protobuf files
|
- name: Check generated protobuf files
|
||||||
run: |
|
run: |
|
||||||
|
export PATH="$RUNNER_TEMP/protoc/bin:$PATH"
|
||||||
# Remove old outputs so orphaned pb files are also detected.
|
# Remove old outputs so orphaned pb files are also detected.
|
||||||
git ls-files -z -- '*.pb.go' | xargs -0 -r rm --
|
git ls-files -z -- '*.pb.go' | xargs -0 -r rm --
|
||||||
go run ./infra/vprotogen
|
go run ./infra/vprotogen
|
||||||
|
|||||||
Reference in New Issue
Block a user