Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/bash/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ runs:

- name: Run
shell: bash
run: ${{ inputs.command }}
run: ${INPUTS_COMMAND}
env:
INPUTS_COMMAND: ${{ inputs.command }}
2 changes: 1 addition & 1 deletion .github/actions/bazel-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ runs:

- name: Hook up repository Cache
shell: bash
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache='/workspace/${{ env.REPOSITORY_CACHE_PATH }}'" >> $GITHUB_ENV
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache='/workspace/${REPOSITORY_CACHE_PATH}'" >> $GITHUB_ENV

- name: Validate inputs
if: ${{ (inputs.bash && inputs.bazel) || (!inputs.bash && !inputs.bazel) }}
Expand Down
21 changes: 15 additions & 6 deletions .github/actions/bazel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ runs:

- name: Hook up repository Cache
shell: bash
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache=$(pwd)/${{ env.REPOSITORY_CACHE_PATH }}" >> $GITHUB_ENV
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache=$(pwd)/${REPOSITORY_CACHE_PATH}" >> $GITHUB_ENV

- name: Validate inputs
if: ${{ (inputs.bash && inputs.bazel) || (!inputs.bash && !inputs.bazel) }}
Expand All @@ -87,7 +87,9 @@ runs:

- name: Pin Bazel version
shell: bash
run: echo "USE_BAZEL_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
run: echo "USE_BAZEL_VERSION=${INPUTS_VERSION}" >> $GITHUB_ENV
env:
INPUTS_VERSION: ${{ inputs.version }}

- name: Output Bazel version
shell: bash
Expand All @@ -106,7 +108,7 @@ runs:
shell: bash
run: |
mkdir -p mac_bazel_workaround
bazelisk ${{ steps.bazel.outputs.bazel-startup-flags }} build @bazel_tools//tools/osx:xcode_locator.m $BAZEL_FLAGS
bazelisk ${STEPS_BAZEL_OUTPUTS_BAZEL_STARTUP_FLAGS} build @bazel_tools//tools/osx:xcode_locator.m $BAZEL_FLAGS
XCODE_LOCATOR_FLAGS="--sdk macosx clang -mmacosx-version-min=10.9 -fobjc-arc -framework CoreServices -framework Foundation"
SINGLE_ARCH_COMPILE_FLAGS="--sdk macosx clang -mmacosx-version-min=10.9 -std=c++11 -lc++ -O3"
COMPILE_FLAGS="$SINGLE_ARCH_COMPILE_FLAGS -arch arm64 -arch x86_64 -Wl,-no_adhoc_codesign -Wl,-no_uuid -O3"
Expand All @@ -115,18 +117,25 @@ runs:
time env -i DEVELOPER_DIR=$DEVELOPER_DIR xcrun $COMPILE_FLAGS -o mac_bazel_workaround/libtool_check_unique $(bazel info output_base)/external/bazel_tools/tools/objc/libtool_check_unique.cc
time env -i DEVELOPER_DIR=$DEVELOPER_DIR xcrun $SINGLE_ARCH_COMPILE_FLAGS -o mac_bazel_workaround/wrapped_clang $(bazel info output_base)/external/bazel_tools/tools/osx/crosstool/wrapped_clang.cc
time env -i DEVELOPER_DIR=$DEVELOPER_DIR xcrun $COMPILE_FLAGS -o mac_bazel_workaround/wrapped_clang $(bazel info output_base)/external/bazel_tools/tools/osx/crosstool/wrapped_clang.cc
env:
STEPS_BAZEL_OUTPUTS_BAZEL_STARTUP_FLAGS: ${{ steps.bazel.outputs.bazel-startup-flags }}

- name: Run Bash
if: ${{ inputs.bash }}
run: ${{ inputs.bash }}
run: ${INPUTS_BASH}
shell: bash
env:
INPUTS_BASH: ${{ inputs.bash }}

- name: Run Bazel
if: ${{ !inputs.bash }}
run: >-
bazelisk ${{ steps.bazel.outputs.bazel-startup-flags }}
${{ inputs.bazel }} $BAZEL_FLAGS
bazelisk ${STEPS_BAZEL_OUTPUTS_BAZEL_STARTUP_FLAGS}
${INPUTS_BAZEL} $BAZEL_FLAGS
shell: bash
env:
STEPS_BAZEL_OUTPUTS_BAZEL_STARTUP_FLAGS: ${{ steps.bazel.outputs.bazel-startup-flags }}
INPUTS_BAZEL: ${{ inputs.bazel }}

- name: Save Bazel repository cache
# Only allow repository cache updates during post-submits.
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/cross-compile-protoc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ runs:

- name: Set protoc environment variable
shell: bash
run: echo "PROTOC=protoc-${{ inputs.architecture }}" >> $GITHUB_ENV
run: echo "PROTOC=protoc-${INPUTS_ARCHITECTURE}" >> $GITHUB_ENV
env:
INPUTS_ARCHITECTURE: ${{ inputs.architecture }}

- name: Extract binary
id: output
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ runs:
- name: Generate docker flags
if: inputs.platform
shell: bash
run: echo "DOCKER_RUN_FLAGS=--platform ${{inputs.platform}}" >> $GITHUB_ENV
run: echo "DOCKER_RUN_FLAGS=--platform ${INPUTS_PLATFORM}" >> $GITHUB_ENV
env:
INPUTS_PLATFORM: ${{inputs.platform}}

- name: Run Docker
uses: ./.github/actions/internal/docker-run
Expand Down
7 changes: 5 additions & 2 deletions .github/actions/internal/bazel-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ runs:
shell: bash
run: >-
echo "BAZEL_FLAGS=$BAZEL_FLAGS
--google_credentials=${{ inputs.credentials-file }}
--remote_cache=https://storage.googleapis.com/protobuf-bazel-cache/protobuf/gha/${{ inputs.bazel-cache }}" >> $GITHUB_ENV
--google_credentials=${INPUTS_CREDENTIALS_FILE}
--remote_cache=https://storage.googleapis.com/protobuf-bazel-cache/protobuf/gha/${INPUTS_BAZEL_CACHE}" >> $GITHUB_ENV
env:
INPUTS_CREDENTIALS_FILE: ${{ inputs.credentials-file }}
INPUTS_BAZEL_CACHE: ${{ inputs.bazel-cache }}

- name: Configure Bazel cache writing
# External runs should never write to our caches.
Expand Down
14 changes: 10 additions & 4 deletions .github/actions/internal/ccache-setup-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ runs:
- name: Setup ccache path
shell: bash
run: |
echo "CCACHE_EXE_PATH=$LOCALAPPDATA\ccache-${{ inputs.ccache-version }}-windows-x86_64" >> $GITHUB_ENV
echo "$LOCALAPPDATA\ccache-${{ inputs.ccache-version }}-windows-x86_64" >> $GITHUB_PATH
echo "CCACHE_EXE_PATH=$LOCALAPPDATA\ccache-${INPUTS_CCACHE_VERSION}-windows-x86_64" >> $GITHUB_ENV
echo "$LOCALAPPDATA\ccache-${INPUTS_CCACHE_VERSION}-windows-x86_64" >> $GITHUB_PATH
env:
INPUTS_CCACHE_VERSION: ${{ inputs.ccache-version }}

- name: Add ccache to Powershell path
shell: pwsh
run: echo "%LOCALAPPDATA%\ccache-${{ inputs.ccache-version }}-windows-x86_64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
run: echo "%LOCALAPPDATA%\ccache-$env:INPUTS_CCACHE_VERSION-windows-x86_64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
env:
INPUTS_CCACHE_VERSION: ${{ inputs.ccache-version }}

- name: Setup caching of ccache download
if: ${{ github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}
Expand All @@ -47,10 +51,12 @@ runs:
if: ${{ steps.ccache-cache.outputs.cache-hit != 'true' && steps.ccache-restore.outputs.cache-hit != 'true'}}
run: |
cd $LOCALAPPDATA
curl -kLSs "https://github.com/ccache/ccache/releases/download/v${{ inputs.ccache-version }}/ccache-${{ inputs.ccache-version }}-windows-x86_64.zip" -o ccache.zip
curl -kLSs "https://github.com/ccache/ccache/releases/download/v${INPUTS_CCACHE_VERSION}/ccache-${INPUTS_CCACHE_VERSION}-windows-x86_64.zip" -o ccache.zip
unzip ccache.zip
rm ccache.zip
ccache --version
env:
INPUTS_CCACHE_VERSION: ${{ inputs.ccache-version }}

- name: Configure ccache environment variables
shell: pwsh
Expand Down
24 changes: 17 additions & 7 deletions .github/actions/internal/docker-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,32 @@ runs:
shell: bash
if: ${{ inputs.docker-cache && steps.check-docker-cache.outputs.cache-hit != 'true' }}
run: >
time docker pull -q ${{ inputs.image }} &&
mkdir -p ci/docker/$(dirname ${{ inputs.image }}) &&
time docker image save ${{ inputs.image }} --output ./ci/docker/${{ inputs.image }}.tar
time docker pull -q ${INPUTS_IMAGE} &&
mkdir -p ci/docker/$(dirname ${INPUTS_IMAGE}) &&
time docker image save ${INPUTS_IMAGE} --output ./ci/docker/${INPUTS_IMAGE}.tar
env:
INPUTS_IMAGE: ${{ inputs.image }}

- name: Use the cached image on cache hit
shell: bash
if: ${{ inputs.docker-cache && steps.check-docker-cache.outputs.cache-hit == 'true' }}
run: time docker image load --input ./ci/docker/${{ inputs.image }}.tar
run: time docker image load --input ./ci/docker/${INPUTS_IMAGE}.tar
env:
INPUTS_IMAGE: ${{ inputs.image }}

- name: Pull fresh docker image
shell: bash
if: ${{ !inputs.docker-cache }}
run: time docker pull -q ${{ inputs.image }}
run: time docker pull -q ${INPUTS_IMAGE}
env:
INPUTS_IMAGE: ${{ inputs.image }}

- name: Run docker
shell: bash
run: >
time docker run ${{ inputs.run-flags}} -v${{ github.workspace }}:/workspace
${{ inputs.image }} ${{ inputs.command }}
time docker run ${INPUTS_RUN_FLAGS} -v${{ github.workspace }}:/workspace
${INPUTS_IMAGE} ${INPUTS_COMMAND}
env:
INPUTS_RUN_FLAGS: ${{ inputs.run-flags}}
INPUTS_IMAGE: ${{ inputs.image }}
INPUTS_COMMAND: ${{ inputs.command }}
6 changes: 4 additions & 2 deletions .github/actions/internal/gcloud-auth/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ runs:

- name: Store credentials path
shell: bash
run: echo "CREDENTIALS_FILE=${{ steps.auth.outputs.credentials_file_path }}" >> $GITHUB_ENV
run: echo "CREDENTIALS_FILE=${STEPS_AUTH_OUTPUTS_CREDENTIALS_FILE_PATH}" >> $GITHUB_ENV
env:
STEPS_AUTH_OUTPUTS_CREDENTIALS_FILE_PATH: ${{ steps.auth.outputs.credentials_file_path }}

- name: Fix credentials path (Windows)
if: ${{ runner.os == 'Windows' }}
Expand All @@ -39,4 +41,4 @@ runs:
- name: Output credentials file
id: output
shell: bash
run: echo "credentials-file=${{ env.CREDENTIALS_FILE }}" >> $GITHUB_OUTPUT
run: echo "credentials-file=${CREDENTIALS_FILE}" >> $GITHUB_OUTPUT
4 changes: 3 additions & 1 deletion .github/actions/internal/repository-cache-restore/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ runs:
run: |
REPOSITORY_CACHE_BASE=repository-cache-${{ github.base_ref || github.ref_name }}-${{ runner.os }}
echo "REPOSITORY_CACHE_BASE=$REPOSITORY_CACHE_BASE" >> $GITHUB_ENV
echo "REPOSITORY_CACHE_NAME=$REPOSITORY_CACHE_BASE-${{ inputs.bazel-cache}}-${{ github.sha }}" >> $GITHUB_ENV
echo "REPOSITORY_CACHE_NAME=$REPOSITORY_CACHE_BASE-${INPUTS_BAZEL_CACHE}-${{ github.sha }}" >> $GITHUB_ENV
echo "REPOSITORY_CACHE_PATH=.repository-cache" >> $GITHUB_ENV
env:
INPUTS_BAZEL_CACHE: ${{ inputs.bazel-cache}}

- name: Restore Bazel repository cache
id: restore-cache
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/forked_pr_workflow_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ jobs:
steps:
- run: >
${{ github.event.pull_request.head.repo.full_name == 'protocolbuffers/protobuf' }} ||
(echo "This pull request is from an unsafe fork (${{ github.event.pull_request.head.repo.full_name }}) and isn't allowed to modify workflow files!" && exit 1)
(echo "This pull request is from an unsafe fork (${GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME}) and isn't allowed to modify workflow files!" && exit 1)
env:
GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
6 changes: 3 additions & 3 deletions .github/workflows/update_php_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Push Changes
run: |
git add --all
git commit --allow-empty -m "${{ env.VERSION }} sync"
git commit --allow-empty -m "${VERSION} sync"
git push --force origin master
git tag -a ${{ env.VERSION_TAG }} -m "Tag release ${{ env.VERSION_TAG }}"
git push origin ${{ env.VERSION_TAG }}
git tag -a ${VERSION_TAG} -m "Tag release ${VERSION_TAG}"
git push origin ${VERSION_TAG}