Skip to content

Commit

Permalink
Merge pull request #9 from protocolbuffers/protoc_static
Browse files Browse the repository at this point in the history
Update cross-compile action to use protoc_static
  • Loading branch information
mkruskal-google authored Mar 4, 2023
2 parents ba908c4 + e0cacbb commit 86a2a6e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bazel-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inputs:
type: string
image:
required: false
default: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1
default: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-6361b3a6e5c97e9951d03a4de28542fc45f1adab
description: "The docker image to use"
type: string
bazel-cache:
Expand Down
8 changes: 4 additions & 4 deletions cross-compile-protoc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ inputs:
type: string
image:
required: false
default: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1
default: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-6361b3a6e5c97e9951d03a4de28542fc45f1adab
description: "The docker image to use"
type: string
outputs:
Expand All @@ -50,8 +50,8 @@ runs:
image: ${{ inputs.image }}
bazel-cache: xcompile-protoc/${{ inputs.architecture }}
bash: |
bazel build //:protoc --config=${{ inputs.architecture }} $BAZEL_FLAGS
cp bazel-bin/protoc .
bazel build //:protoc_static --config=${{ inputs.architecture }} $BAZEL_FLAGS
cp bazel-bin/protoc_static .
- name: Set protoc environment variable
shell: bash
Expand All @@ -61,5 +61,5 @@ runs:
id: output
shell: bash
run: |
mv protoc $PROTOC
mv protoc_static $PROTOC
echo "protoc=$PROTOC" >> $GITHUB_OUTPUT
15 changes: 12 additions & 3 deletions docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inputs:
description: A command to run in the docker image
image:
required: false
default: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1
default: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-6361b3a6e5c97e9951d03a4de28542fc45f1adab
description: "The docker image to use"
type: string
platform:
Expand All @@ -35,6 +35,10 @@ inputs:
required: false
description: "Skip staleness checks"
type: boolean
entrypoint:
required: false
description: "Specify a custom entrypoint for docker"
type: string

runs:
using: 'composite'
Expand All @@ -58,10 +62,15 @@ runs:
bazel-cache: regenerate-stale-files
bash: ./regenerate_stale_files.sh $BAZEL_FLAGS

- name: Generate docker flags
- name: Generate docker platform flags
if: inputs.platform
shell: bash
run: echo "DOCKER_RUN_FLAGS=--platform ${{inputs.platform}}" >> $GITHUB_ENV
run: echo "DOCKER_RUN_FLAGS=--platform ${{inputs.platform}} $DOCKER_RUN_FLAGS" >> $GITHUB_ENV

- name: Generate docker entrypoing flags
if: inputs.entrypoint
shell: bash
run: echo "DOCKER_RUN_FLAGS=--entrypoint ${{inputs.entrypoint}} $DOCKER_RUN_FLAGS " >> $GITHUB_ENV

- name: Run Docker
uses: ./../../_actions/current/internal/docker-run
Expand Down

0 comments on commit 86a2a6e

Please sign in to comment.