Add daily build #46
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: Daily Platform Build | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
build_type: | |
type: choice | |
description: "Build type" | |
default: 'ReleaseWithDebug' | |
options: | |
- Release | |
- ReleaseWithDebug | |
- Debug | |
toolchain_version: | |
type: choice | |
description: "Toolchain version" | |
default: 'v4' | |
options: | |
- v4 | |
- v5 | |
memgraph_tag: | |
description: "Memgraph version (choose master to use the latest source)" | |
default: 'master' | |
mage_tag: | |
description: "Mage version (choose main to use the latest source)" | |
default: 'main' | |
lab_tag: | |
description: "Lab version (choose dev to use the latest source)" | |
default: 'dev' | |
env: | |
TOOLCHAIN_VERSION: ${{ github.events.inputs.toolchain_version || 'v4' }} | |
MG_PACKAGE_TARGET_PATH: "scripts/dist/package/memgraph.deb" | |
MEMGRAPH_TAG: ${{ github.event.inputs.memgraph_tag || 'master' }} | |
MAGE_TAG: ${{ github.event.inputs.mage_tag || 'main' }} | |
LAB_TAG: ${{ github.event.inputs.lab_tag || 'dev' }} | |
jobs: | |
build_amd64: | |
name: "Build memgraph plaftorm for amd64" | |
runs-on: [self-hosted, Docker, X64] | |
env: | |
ARCHITECTURE: "amd64" | |
TARGET_OS: "debian-11" | |
steps: | |
- name: "Checkout repository and submodules" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
token: ${{ secrets.PAT }} | |
- name: "Checkout correct versions in submodules" | |
run: | | |
cd mage/cpp/memgraph && git checkout ${{ env.MEMGRAPH_TAG }} && cd ../.. | |
git checkout ${{ env.MAGE_TAG }} && cd .. | |
cd lab && git checkout ${{ env.LAB_TAG }} && cd .. | |
- name: "Build memgraph" | |
run: | | |
./scripts/pack_memgraph_via_docker.sh pack | |
./scripts/pack_memgraph_via_docker.sh copy_package | |
./scripts/pack_memgraph_via_docker.sh cleanup | |
mv scripts/dist/package/memgraph*.deb ${{ env.MG_PACKAGE_TARGET_PATH }} | |
env: | |
MGPLAT_CNT_IMAGE: "memgraph/memgraph-builder:${{ env.TOOLCHAIN_VERSION }}_${{ env.TARGET_OS }}" | |
MGPLAT_CNT_NAME: "mgbuilder_${{ env.TARGET_OS }}" | |
MGPLAT_CNT_MG_ROOT: "/platform/mage/cpp/memgraph" | |
MGPLAT_MG_TAG: ${{ env.MEMGRAPH_TAG }} | |
MGPLAT_MG_BUILD_TYPE: ${{ github.event.inputs.build_type || 'ReleaseWithDebug' }} | |
- name: "Upload memgraph binary" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: memgraph_${{ env.TARGET_OS }}.deb | |
path: ${{ env.MG_PACKAGE_TARGET_PATH }} | |
- name: "Build Mage" | |
run: | | |
./scripts/docker_image_mage.sh build ${{ env.MG_PACKAGE_TARGET_PATH }} mage_${{ env.ARCHITECTURE }} ${{ env.ARCHITECTURE }} | |
- name: "Upload mage docker image" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mage_${{ env.ARCHITECTURE }}.tar.gz | |
path: scripts/dist/docker/mage_${{ env.ARCHITECTURE }}.tar.gz | |
- name: "Build memgraph platform" | |
run: | | |
./scripts/docker_image_platform.sh build ${{ env.MG_PACKAGE_TARGET_PATH }} memgraph-platform_${{ env.ARCHITECTURE }} ${{ env.ARCHITECTURE }} | |
env: | |
MGPLAT_GHA_PAT_TOKEN: ${{ secrets.PAT }} | |
- name: "Upload memgraph platform docker image" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: memgraph-platform_${{ env.ARCHITECTURE }}.tar.gz | |
path: scripts/dist/docker/memgraph-platform_${{ env.ARCHITECTURE }}.tar.gz | |
build_arm64: | |
name: "Build memgraph plaftorm for arm64" | |
runs-on: [self-hosted, DockerMgBuild, ARM64, strange] | |
env: | |
ARCHITECTURE: "arm64" | |
TARGET_OS: "debian-11-arm" | |
steps: | |
- name: "Checkout repository and submodules" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
token: ${{ secrets.PAT }} | |
- name: "Checkout correct versions in submodules" | |
run: | | |
cd mage/cpp/memgraph && git checkout ${{ env.MEMGRAPH_TAG }} && cd ../.. | |
git checkout ${{ env.MAGE_TAG }} && cd .. | |
cd lab && git checkout ${{ env.LAB_TAG }} && cd .. | |
- name: "Build memgraph" | |
run: | | |
./scripts/pack_memgraph_via_docker.sh pack | |
./scripts/pack_memgraph_via_docker.sh copy_package | |
./scripts/pack_memgraph_via_docker.sh cleanup | |
mv scripts/dist/package/memgraph*.deb ${{ env.MG_PACKAGE_TARGET_PATH }} | |
env: | |
MGPLAT_CNT_IMAGE: "memgraph/memgraph-builder:${{ env.TOOLCHAIN_VERSION }}_${{ env.TARGET_OS }}" | |
MGPLAT_CNT_NAME: "mgbuilder_${{ env.TARGET_OS }}" | |
MGPLAT_CNT_MG_ROOT: "/platform/mage/cpp/memgraph" | |
MGPLAT_MG_TAG: ${{ env.MEMGRAPH_TAG }} | |
MGPLAT_MG_BUILD_TYPE: ${{ github.event.inputs.build_type || 'ReleaseWithDebug' }} | |
- name: "Upload memgraph binary" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: memgraph_${{ env.TARGET_OS }}.deb | |
path: ${{ env.MG_PACKAGE_TARGET_PATH }} | |
- name: "Build Mage" | |
run: | | |
./scripts/docker_image_mage.sh build ${{ env.MG_PACKAGE_TARGET_PATH }} mage_${{ env.ARCHITECTURE }} ${{ env.ARCHITECTURE }} | |
- name: "Upload mage docker image" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mage_${{ env.ARCHITECTURE }}.tar.gz | |
path: scripts/dist/docker/mage_${{ env.ARCHITECTURE }}.tar.gz | |
- name: "Build memgraph platform" | |
run: | | |
./scripts/docker_image_platform.sh build ${{ env.MG_PACKAGE_TARGET_PATH }} memgraph-platform_${{ env.ARCHITECTURE }} ${{ env.ARCHITECTURE }} | |
env: | |
MGPLAT_GHA_PAT_TOKEN: ${{ secrets.PAT }} | |
- name: "Upload memgraph platform docker image" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: memgraph-platform_${{ env.ARCHITECTURE }}.tar.gz | |
path: scripts/dist/docker/memgraph-platform_${{ env.ARCHITECTURE }}.tar.gz |