From 597b4430ba8f9e4da39b24eb1c16f720dcec8285 Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Tue, 6 Feb 2024 07:47:29 -0800 Subject: [PATCH] GitHub workflows: Combine SAPI generator build and "prerelease" PiperOrigin-RevId: 604644955 Change-Id: Ie855b0d5699d1f8e201d2ecae821f7adb2c75c17 --- .../workflows/debian-sapi-generator-tool.yml | 66 ----------------- ...ate-pre-release.yml => generator-tool.yml} | 73 +++++++++++++++++-- 2 files changed, 67 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/debian-sapi-generator-tool.yml rename .github/workflows/{generate-pre-release.yml => generator-tool.yml} (50%) diff --git a/.github/workflows/debian-sapi-generator-tool.yml b/.github/workflows/debian-sapi-generator-tool.yml deleted file mode 100644 index 314e178..0000000 --- a/.github/workflows/debian-sapi-generator-tool.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: debian-sapi-generator-tool -on: push -jobs: - build: - runs-on: ubuntu-latest - container: debian:10.13 - steps: - - uses: actions/checkout@v3 - - - name: Cache dependencies - uses: actions/cache@v3 - with: - key: debian-10.13-clang16 - path: | - ${{github.workspace}}/build/_deps - - - name: Install build tools - run: | - apt-get update - env DEBIAN_FRONTEND=noninteractive \ - apt-get install -qy --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - file \ - git \ - gnupg \ - libc6-dev \ - lsb-release \ - make \ - ninja-build \ - software-properties-common \ - wget - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - ./llvm.sh 16 all - - - name: Configure CMake - run: | - mkdir -p "$GITHUB_WORKSPACE/build" - cmake \ - -S "$GITHUB_WORKSPACE" \ - -B "$GITHUB_WORKSPACE/build" \ - -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DSAPI_ENABLE_CLANG_TOOL=ON \ - -DSAPI_ENABLE_CLANG_TOOL_STATIC=ON - - - name: Build - run: | - cmake \ - --build "$GITHUB_WORKSPACE/build" \ - --config Release \ - --target sapi_generator_tool - ( \ - cd "$GITHUB_WORKSPACE/build"; \ - mv sandboxed_api/tools/clang_generator/sapi_generator_tool \ - sapi_generator_tool-linux-x86_64; \ - ) - - - name: Upload Build Artifact - uses: actions/upload-artifact@v3.1.2 - with: - name: sapi_generator_tool-linux - path: ${{github.workspace}}/build/sapi_generator_tool-linux-x86_64 - diff --git a/.github/workflows/generate-pre-release.yml b/.github/workflows/generator-tool.yml similarity index 50% rename from .github/workflows/generate-pre-release.yml rename to .github/workflows/generator-tool.yml index 8969e84..3e9d7bb 100644 --- a/.github/workflows/generate-pre-release.yml +++ b/.github/workflows/generator-tool.yml @@ -1,11 +1,71 @@ -name: generate-pre-release -on: - workflow_run: - workflows: [debian-sapi-generator-tool] - types: [completed] - branches: [main] +name: generator-tool +on: push jobs: + build: + runs-on: ubuntu-latest + container: debian:10.13 + steps: + - uses: actions/checkout@v3 + + - name: Cache dependencies + uses: actions/cache@v3 + with: + key: debian-10.13-clang16 + path: | + ${{github.workspace}}/build/_deps + + - name: Install build tools + run: | + apt-get update + env DEBIAN_FRONTEND=noninteractive \ + apt-get install -qy --no-install-recommends \ + build-essential \ + ca-certificates \ + cmake \ + file \ + git \ + gnupg \ + libc6-dev \ + lsb-release \ + make \ + ninja-build \ + software-properties-common \ + wget + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + ./llvm.sh 16 all + + - name: Configure CMake + run: | + mkdir -p "$GITHUB_WORKSPACE/build" + cmake \ + -S "$GITHUB_WORKSPACE" \ + -B "$GITHUB_WORKSPACE/build" \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DSAPI_ENABLE_CLANG_TOOL=ON \ + -DSAPI_ENABLE_CLANG_TOOL_STATIC=ON + + - name: Build + run: | + cmake \ + --build "$GITHUB_WORKSPACE/build" \ + --config Release \ + --target sapi_generator_tool + ( \ + cd "$GITHUB_WORKSPACE/build"; \ + mv sandboxed_api/tools/clang_generator/sapi_generator_tool \ + sapi_generator_tool-linux-x86_64; \ + ) + + - name: Upload Build Artifact + uses: actions/upload-artifact@v3.1.2 + with: + name: sapi_generator_tool-linux + path: ${{github.workspace}}/build/sapi_generator_tool-linux-x86_64 + prerelease: + needs: build runs-on: ubuntu-latest env: ARTIFACT_NAME: sapi_generator_tool-linux @@ -58,3 +118,4 @@ jobs: prerelease: true files: | ${{github.workspace}}/build/sapi_generator_tool-linux-x86_64.tar.gz +