|
| 1 | +on: |
| 2 | + release: |
| 3 | + types: |
| 4 | + # TODO: is this right? |
| 5 | + - created |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + runs-on: ubuntu-24.04 |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
| 11 | + - uses: tespkg/actions-cache/restore@91b54a6e03abb8fcec12d3743633d23a1cfcd269 |
| 12 | + with: |
| 13 | + endpoint: storage.yandexcloud.net |
| 14 | + accessKey: ${{ secrets.CACHE_ACCESS_KEY }} |
| 15 | + secretKey: ${{ secrets.CACHE_SECRET_KEY }} |
| 16 | + bucket: ${{ secrets.CACHE_BUCKET }} |
| 17 | + # Don't bother trying github cache, we don't fit in its 10GB limit |
| 18 | + use-fallback: false |
| 19 | + key: v1-${{ github.sha }} |
| 20 | + restore-keys: | |
| 21 | + v1- |
| 22 | + path: ~/.ya/build |
| 23 | + - name: Build binaries |
| 24 | + run: | |
| 25 | + ./ya make -r --musl -DSTRIP ./perforator/bundle |
| 26 | + - uses: actions/upload-artifact@v4 |
| 27 | + with: |
| 28 | + name: binaries |
| 29 | + path: ./perforator/bundle |
| 30 | + build-autofdo: |
| 31 | + runs-on: ubuntu-24.04 |
| 32 | + steps: |
| 33 | + - uses: actions/cache@v4 |
| 34 | + with: |
| 35 | + path: ./autofdo/build |
| 36 | + key: v1-${{ github.sha }} |
| 37 | + restore-keys: | |
| 38 | + v1- |
| 39 | + - name: Build AutoFDO |
| 40 | + run: | |
| 41 | + sudo apt-get update |
| 42 | + sudo apt-get install -y libunwind-dev libgflags-dev libssl-dev libelf-dev protobuf-compiler \ |
| 43 | + cmake libzstd-dev clang g++ git build-essential |
| 44 | + git clone --recursive --depth 1 https://github.com/google/autofdo.git |
| 45 | + cd autofdo |
| 46 | + git checkout 8f9ab68921f364a6433086245ca3f19befacfeb1 |
| 47 | + git submodule update --init --recursive |
| 48 | + mkdir build |
| 49 | + cd build |
| 50 | + cmake -DENABLE_TOOL=LLVM -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release ../ |
| 51 | + make -j $(nproc) create_llvm_prof |
| 52 | + - uses: actions/upload-artifact@v4 |
| 53 | + with: |
| 54 | + name: autofdo |
| 55 | + path: ./autofdo/build/create_llvm_prof |
| 56 | + release-cli: |
| 57 | + runs-on: ubuntu-24.04 |
| 58 | + needs: |
| 59 | + - build |
| 60 | + steps: |
| 61 | + - uses: actions/download-artifact@v4 |
| 62 | + with: |
| 63 | + name: binaries |
| 64 | + - name: Attach binaries to release |
| 65 | + run: | |
| 66 | + chmod +x ./cli |
| 67 | + chmod +x ./migrate |
| 68 | + gh -R ${{ github.repository }} release upload ${{ github.event.release.tag_name }} ./cli ./migrate |
| 69 | + env: |
| 70 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + release-images: |
| 72 | + runs-on: ubuntu-24.04 |
| 73 | + needs: |
| 74 | + - build |
| 75 | + - build-autofdo |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + - uses: actions/download-artifact@v4 |
| 79 | + with: |
| 80 | + name: binaries |
| 81 | + path: dist |
| 82 | + - uses: actions/download-artifact@v4 |
| 83 | + with: |
| 84 | + name: autofdo |
| 85 | + - name: Log in to registry |
| 86 | + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin |
| 87 | + - name: Build and push images |
| 88 | + run: | |
| 89 | + mv ./create_llvm_prof ./dist/ |
| 90 | + chmod +x ./dist/create_llvm_prof |
| 91 | + function build { |
| 92 | + chmod +x ./dist/$1 |
| 93 | + docker build -f perforator/deploy/docker/Dockerfile.prebuilt --target $1 --push --tag ghcr.io/${{ github.repository }}/$1:${{ github.event.release.tag_name }} ./dist |
| 94 | + } |
| 95 | + build agent |
| 96 | + build gc |
| 97 | + build migrate |
| 98 | + build offline_processing |
| 99 | + build proxy |
| 100 | + build storage |
| 101 | + build web |
| 102 | +
|
0 commit comments