|
| 1 | +name: Build CE Platform |
| 2 | + |
| 3 | +env: |
| 4 | + VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,read" |
| 5 | + VCPKG_NUGET_REPOSITORY: "https://github.com/hpcc-systems/vcpkg" |
| 6 | + |
| 7 | +on: |
| 8 | + #workflow_dispatch |
| 9 | + push: |
| 10 | + |
| 11 | +jobs: |
| 12 | + preamble: |
| 13 | + name: Publish Release |
| 14 | + env: |
| 15 | + COMMUNITY_REF: "8e94be577a0ae81325914be56cc111584e108f1b" |
| 16 | + #COMMUNITY_REF: <GIT REF> |
| 17 | + GITHUB_ACCOUNT: ${{ github.repository_owner }} |
| 18 | + runs-on: ubuntu-22.04 |
| 19 | + permissions: |
| 20 | + contents: write |
| 21 | + outputs: |
| 22 | + folder_platform: ${{ steps.vars.outputs.folder_platform }} |
| 23 | + mount_platform: ${{ steps.vars.outputs.mount_platform }} |
| 24 | + folder_build: ${{ steps.vars.outputs.folder_build }} |
| 25 | + mount_build: ${{ steps.vars.outputs.mount_build }} |
| 26 | + community_ref: ${{ steps.vars.outputs.community_ref }} |
| 27 | + community_tag: ${{ steps.vars.outputs.community_tag }} |
| 28 | + hpcc_version: ${{ steps.vars.outputs.hpcc_version }} |
| 29 | + candidate_base_branch: ${{ steps.vars.outputs.candidate_base_branch }} |
| 30 | + candidate_branch: ${{ steps.vars.outputs.candidate_branch }} |
| 31 | + cmake_docker_config: ${{ steps.vars.outputs.cmake_docker_config }} |
| 32 | + gpg_import: ${{ steps.vars.outputs.gpg_import }} |
| 33 | + github_account: ${{ steps.vars.outputs.github_account }} |
| 34 | + steps: |
| 35 | + - name: Calculate vars |
| 36 | + id: vars |
| 37 | + run: | |
| 38 | + github_account=${{ env.GITHUB_ACCOUNT }} |
| 39 | + echo "github_account=$github_account" >> $GITHUB_OUTPUT |
| 40 | + echo "folder_platform=${{ github.workspace }}/HPCC-Platform" >> $GITHUB_OUTPUT |
| 41 | + echo 'mount_platform=source="${{ github.workspace }}/HPCC-Platform",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=cached' >> $GITHUB_OUTPUT |
| 42 | + echo "folder_build=${{ github.workspace }}/build" >> $GITHUB_OUTPUT |
| 43 | + echo 'mount_build=source="${{ github.workspace }}/build",target=/hpcc-dev/build,type=bind,consistency=cached' >> $GITHUB_OUTPUT |
| 44 | + community_ref=${{ env.COMMUNITY_REF }} |
| 45 | + echo "community_ref=$community_ref" >> $GITHUB_OUTPUT |
| 46 | + community_tag=$(echo $community_ref | cut -d'/' -f3) |
| 47 | + echo "community_tag=$community_tag" >> $GITHUB_OUTPUT |
| 48 | + echo "hpcc_version=$(echo $community_tag | sed 's/community_//' | sed 's/-[0-9]$//')" >> $GITHUB_OUTPUT |
| 49 | + community_base_ref=${{ github.event.base_ref || github.ref }} |
| 50 | + candidate_branch=$(echo $community_base_ref | cut -d'/' -f3) |
| 51 | + echo "candidate_branch=$candidate_branch" >> $GITHUB_OUTPUT |
| 52 | + echo "candidate_base_branch=$(echo $candidate_branch | awk -F'.' -v OFS='.' '{ $3="x"; print }')" >> $GITHUB_OUTPUT |
| 53 | + echo "cmake_docker_config=-DCMAKE_BUILD_TYPE=RelWithDebInfo -DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF -DSIGN_MODULES=${{ env.GITHUB_ACCOUNT == 'hpcc-systems' && 'ON' || 'OFF' }}" >> $GITHUB_OUTPUT |
| 54 | + echo 'gpg_import=gpg --batch --import /hpcc-dev/build/private.key' >> $GITHUB_OUTPUT |
| 55 | +
|
| 56 | + - name: Print vars |
| 57 | + run: | |
| 58 | + echo "${{ toJSON(steps.vars.outputs) }})" |
| 59 | +
|
| 60 | + build-docker: |
| 61 | + name: Build Docker |
| 62 | + needs: preamble |
| 63 | + runs-on: ubuntu-22.04 |
| 64 | + strategy: |
| 65 | + matrix: |
| 66 | + include: |
| 67 | + #- os: ubuntu-24.04 |
| 68 | + #- os: ubuntu-22.04 |
| 69 | + - os: rockylinux-8 |
| 70 | + #- os: centos-8 |
| 71 | + #- os: centos-7 |
| 72 | + #cmake_options_extra: "-DVCPKG_TARGET_TRIPLET=x64-centos-7-dynamic" |
| 73 | + fail-fast: false |
| 74 | + |
| 75 | + steps: |
| 76 | + - name: Free additional disk space (remove Android SDK + Tools) |
| 77 | + continue-on-error: true |
| 78 | + run: | |
| 79 | + df -h |
| 80 | + sudo rm -rf ${ANDROID_HOME} |
| 81 | + sudo rm -rf ${JAVA_HOME_8_X64} |
| 82 | + sudo rm -rf ${JAVA_HOME_11_X64} |
| 83 | + sudo rm -rf ${JAVA_HOME_17_X64} |
| 84 | + sudo rm -rf ${JAVA_HOME_21_X64} |
| 85 | + sudo rm -rf ${CHROMEWEBDRIVER} |
| 86 | + sudo rm -rf ${EDGEWEBDRIVER} |
| 87 | + sudo rm -rf ${GECKOWEBDRIVER} |
| 88 | + sudo rm -rf ${SELENIUM_JAR_PATH} |
| 89 | +
|
| 90 | + - name: Display disk space (post free) |
| 91 | + run: | |
| 92 | + df -h |
| 93 | +
|
| 94 | + - name: Checkout HPCC-Platform |
| 95 | + uses: actions/checkout@v3 |
| 96 | + with: |
| 97 | + repository: ${{ needs.preamble.outputs.github_account }}/HPCC-Platform |
| 98 | + ref: ${{ needs.preamble.outputs.community_ref }} |
| 99 | + submodules: recursive |
| 100 | + path: ${{ needs.preamble.outputs.folder_platform }} |
| 101 | + |
| 102 | + - name: Calculate vars |
| 103 | + id: vars |
| 104 | + working-directory: ${{ needs.preamble.outputs.folder_platform }}/vcpkg |
| 105 | + run: | |
| 106 | + vcpkg_sha_short=$(git rev-parse --short=8 HEAD) |
| 107 | + echo "vcpkg_sha_short=$vcpkg_sha_short" >> $GITHUB_OUTPUT |
| 108 | + docker_build_label=hpccsystems/platform-build-${{ matrix.os }} |
| 109 | + echo "docker_build_label=$docker_build_label" >> $GITHUB_OUTPUT |
| 110 | + echo "docker_tag=$docker_build_label:$vcpkg_sha_short" >> $GITHUB_OUTPUT |
| 111 | + echo "docker_tag_candidate_base=$docker_build_label:${{ needs.preamble.outputs.candidate_base_branch }}" >> $GITHUB_OUTPUT |
| 112 | +
|
| 113 | + - name: Print vars |
| 114 | + run: | |
| 115 | + echo "${{ toJSON(needs.preamble.outputs) }})" |
| 116 | + echo "${{ toJSON(steps.vars.outputs) }})" |
| 117 | +
|
| 118 | + - name: Set up Docker Buildx |
| 119 | + id: buildx |
| 120 | + uses: docker/setup-buildx-action@v2 |
| 121 | + |
| 122 | + - name: Login to DockerHub |
| 123 | + uses: docker/login-action@v2 |
| 124 | + with: |
| 125 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 126 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 127 | + |
| 128 | + - name: Create Build Image |
| 129 | + uses: docker/build-push-action@v4 |
| 130 | + with: |
| 131 | + builder: ${{ steps.buildx.outputs.name }} |
| 132 | + file: ${{ needs.preamble.outputs.folder_platform }}/dockerfiles/vcpkg/${{ matrix.os }}.dockerfile |
| 133 | + context: ${{ needs.preamble.outputs.folder_platform }}/dockerfiles/vcpkg |
| 134 | + push: ${{ needs.preamble.outputs.github_account == 'hpcc-systems' }} |
| 135 | + load: ${{ needs.preamble.outputs.github_account != 'hpcc-systems' }} |
| 136 | + build-args: | |
| 137 | + VCPKG_REF=${{ steps.vars.outputs.vcpkg_sha_short }} |
| 138 | + tags: | |
| 139 | + ${{ steps.vars.outputs.docker_tag_candidate_base }} |
| 140 | + cache-from: | |
| 141 | + type=registry,ref=${{ steps.vars.outputs.docker_tag_candidate_base }} |
| 142 | + type=registry,ref=${{ steps.vars.outputs.docker_tag }} |
| 143 | + cache-to: type=inline |
| 144 | + |
| 145 | + # Communtiy Build |
| 146 | + - name: CMake Packages (community) |
| 147 | + if: ${{ !matrix.ln && !matrix.ee && !matrix.container && !matrix.documentation }} |
| 148 | + run: | |
| 149 | + echo "gcc packages installed" |
| 150 | + sudo rpm -qa |
| 151 | + mkdir -p ${{needs.preamble.outputs.folder_build }} |
| 152 | + echo "${{ secrets.SIGNING_SECRET }}" > ${{ needs.preamble.outputs.folder_build }}/private.key |
| 153 | +
|
| 154 | + sudo rm -f ${{ needs.preamble.outputs.folder_build }}/CMakeCache.txt |
| 155 | + sudo rm -rf ${{ needs.preamble.outputs.folder_build }}/CMakeFiles |
| 156 | +
|
| 157 | + docker run --rm --mount ${{ needs.preamble.outputs.mount_platform }} --mount ${{ needs.preamble.outputs.mount_build }} ${{ steps.vars.outputs.docker_tag_candidate_base }} "${{ needs.preamble.outputs.gpg_import }} && \ |
| 158 | + rpm -qa | grep gcc |
| 159 | + ls -l /usr/bin/g++" |
| 160 | +
|
0 commit comments