Release v29.0rc2 #55
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- v* | |
permissions: | |
contents: write | |
jobs: | |
get-protobuf: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.protobuf.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get Protobuf | |
id: protobuf | |
run: | | |
tag=$(git describe --tags --abbrev=0 --exact-match) | |
release_version="${tag:1}" | |
curl -L https://github.com/protocolbuffers/protobuf/releases/download/${tag}/protobuf-${release_version}.tar.gz > ./protobuf.tar.gz | |
echo "version=${release_version}" >> $GITHUB_OUTPUT | |
- name: Upload Protobuf | |
uses: actions/upload-artifact@v4 | |
with: | |
name: protobuf | |
path: ./protobuf.tar.gz | |
build-linux_x86_64: | |
runs-on: ubuntu-20.04 | |
needs: get-protobuf | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Protobuf | |
uses: actions/download-artifact@v4 | |
with: | |
name: protobuf | |
- name: Bazel Cache | |
id: bazel-cache | |
uses: actions/cache@v4 | |
env: | |
version: 4.2.1 | |
with: | |
path: | | |
~/.cache/bazel | |
key: ${{ runner.os }}-{{ env.version }}-bazel-cache | |
- name: Install bazelisk | |
run: | | |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64" | |
mkdir -p "${GITHUB_WORKSPACE}/bin/" | |
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" | |
chmod +x "${GITHUB_WORKSPACE}/bin/bazel" | |
- name: Build Binary | |
run: | | |
tar -xf protobuf.tar.gz | |
cd ./protobuf-${{ needs.get-protobuf.outputs.version }} | |
USE_BAZEL_VERSION=6.3.0 BAZEL_CXXOPTS="-std=c++14" bazel build conformance:conformance_test_runner --toolchain_resolution_debug=@bazel_tools//tools/cpp:toolchain_type | |
- name: Rename Binary | |
run: | | |
mkdir -p .tmp/bin | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/bazel-bin/conformance/conformance_test_runner .tmp/bin/conformance_test_runner | |
- name: Verify Binary | |
run: | | |
.tmp/bin/conformance_test_runner --help 2>&1 | grep 'Usage: conformance-test-runner \[options\] <test-program>' || { echo "Build looks broken"; exit 1; } | |
- name: Copy Protos | |
run: | | |
mkdir -p .tmp/include/conformance | |
mkdir -p .tmp/include/google/protobuf | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/conformance/conformance.proto .tmp/include/conformance | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/editions/golden/test_messages*.proto .tmp/include/google/protobuf | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/conformance/test_protos/test_messages*.proto .tmp/include/google/protobuf | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/src/google/protobuf/test_messages*.proto .tmp/include/google/protobuf | |
- name: Zip Binary | |
run: | | |
cd .tmp | |
zip -r ../conformance_test_runner-${{ needs.get-protobuf.outputs.version }}-linux-x86_64.zip ./bin ./include | |
- name: Publish GitHub artifacts | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: false | |
body: Conformance runner binaries for Protobuf v${{ needs.get-protobuf.outputs.version }} | |
append_body: false | |
files: | | |
./conformance_test_runner-${{ needs.get-protobuf.outputs.version }}-linux-x86_64.zip | |
build-darwin_x86_64: | |
runs-on: macos-12 | |
needs: get-protobuf | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Protobuf | |
uses: actions/download-artifact@v4 | |
with: | |
name: protobuf | |
- name: Bazel Cache | |
id: bazel-cache | |
uses: actions/cache@v4 | |
env: | |
version: 4.2.1 | |
with: | |
path: | | |
~/.cache/bazel | |
key: ${{ runner.os }}-{{ env.version }}-bazel-cache | |
- name: Install bazelisk | |
run: | | |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-darwin-amd64" | |
mkdir -p "${GITHUB_WORKSPACE}/bin/" | |
mv bazelisk-darwin-amd64 "${GITHUB_WORKSPACE}/bin/bazel" | |
chmod +x "${GITHUB_WORKSPACE}/bin/bazel" | |
- name: Build Binary | |
run: | | |
tar -xf protobuf.tar.gz | |
cd ./protobuf-${{ needs.get-protobuf.outputs.version }} | |
USE_BAZEL_VERSION=6.3.0 BAZEL_CXXOPTS="-std=c++14" bazel build conformance:conformance_test_runner --toolchain_resolution_debug=@bazel_tools//tools/cpp:toolchain_type | |
- name: Rename Binary | |
run: | | |
mkdir -p .tmp/bin | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/bazel-bin/conformance/conformance_test_runner .tmp/bin/conformance_test_runner | |
- name: Verify Binary | |
run: | | |
.tmp/bin/conformance_test_runner --help 2>&1 | grep 'Usage: conformance-test-runner \[options\] <test-program>' || { echo "Build looks broken"; exit 1; } | |
- name: Copy Protos | |
run: | | |
mkdir -p .tmp/include/conformance | |
mkdir -p .tmp/include/google/protobuf | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/conformance/conformance.proto .tmp/include/conformance | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/editions/golden/test_messages*.proto .tmp/include/google/protobuf | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/conformance/test_protos/test_messages*.proto .tmp/include/google/protobuf | |
cp ./protobuf-${{ needs.get-protobuf.outputs.version }}/src/google/protobuf/test_messages*.proto .tmp/include/google/protobuf | |
- name: Zip Binary | |
run: | | |
cd .tmp | |
zip -r ../conformance_test_runner-${{ needs.get-protobuf.outputs.version }}-osx-x86_64.zip ./bin ./include | |
- name: Publish GitHub artifacts | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: false | |
body: Conformance runner binaries for Protobuf v${{ needs.get-protobuf.outputs.version }} | |
append_body: false | |
files: | | |
./conformance_test_runner-${{ needs.get-protobuf.outputs.version }}-osx-x86_64.zip |