From 35d3895a19ebd1fd2c4cfa0e55a469b148b18fc4 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 17:46:44 +0330 Subject: [PATCH 01/19] attempt to move from self hosted runners to github's --- .github/workflows/build.yml | 8 ++++---- .github/workflows/clang-format-check.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06ecabdda..650e061ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ on: jobs: build-windows: name: Windows x86 build - runs-on: [self-hosted, new-runner] + runs-on: windows-2019 steps: - uses: actions/checkout@v3 @@ -79,7 +79,7 @@ jobs: build-linux-static: name: Linux x86 dynssl build - runs-on: [self-hosted, Linux, X64] + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 @@ -114,7 +114,7 @@ jobs: build-linux: name: Linux x86 build - runs-on: [self-hosted, Linux, X64] + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 @@ -151,7 +151,7 @@ jobs: if: github.event_name == 'pull_request' name: SDK ABI check needs: build-linux - runs-on: [self-hosted, Linux, X64] + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 5c9edcd3e..8ec300e7f 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -3,7 +3,7 @@ on: [pull_request] jobs: formatting-check: name: Formatting Check - runs-on: [self-hosted, Linux, X64] + runs-on: ubuntu-latest strategy: matrix: path: From 2a5e1bb5b6d5614dd38675b0867cd4056fcc418c Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 18:34:14 +0330 Subject: [PATCH 02/19] comment `chown` line out for build script --- docker/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build.sh b/docker/build.sh index 5b426f408..41c235021 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -30,7 +30,7 @@ folders=('build' 'conan') for folder in "${folders[@]}"; do if [[ ! -d "./${folder}" ]]; then mkdir ${folder} && - chown 1000:1000 ${folder} || exit 1 + # chown 1000:1000 ${folder} || exit 1 fi done From a271a1121233526cad6983a79a8dd980c14a13f1 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 18:34:23 +0330 Subject: [PATCH 03/19] use ubuntu latest for all because we use dockers --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 650e061ff..51c92415e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: build-linux-static: name: Linux x86 dynssl build - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -114,7 +114,7 @@ jobs: build-linux: name: Linux x86 build - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -151,7 +151,7 @@ jobs: if: github.event_name == 'pull_request' name: SDK ABI check needs: build-linux - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 10e00559c1e19d92a6283fdd04d7d99dd675072e Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 18:40:01 +0330 Subject: [PATCH 04/19] just entirely remove chown line in build script --- docker/build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/build.sh b/docker/build.sh index 41c235021..85316820e 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -29,8 +29,7 @@ docker build \ folders=('build' 'conan') for folder in "${folders[@]}"; do if [[ ! -d "./${folder}" ]]; then - mkdir ${folder} && - # chown 1000:1000 ${folder} || exit 1 + mkdir ${folder} fi done From 89f4aa656e9d8845f53a6f207fe9272839cc9c43 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 18:45:54 +0330 Subject: [PATCH 05/19] run ls-l after creating `build` and `conan` dirs --- docker/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build.sh b/docker/build.sh index 85316820e..fe01d1405 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -29,7 +29,7 @@ docker build \ folders=('build' 'conan') for folder in "${folders[@]}"; do if [[ ! -d "./${folder}" ]]; then - mkdir ${folder} + mkdir ${folder} && ls -l fi done From 28b033520fc4268400e82f52e3a88c8f2a0283dd Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 18:46:16 +0330 Subject: [PATCH 06/19] disable windows ci for now --- .github/workflows/build.yml | 98 ++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51c92415e..e66dc1ffa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,55 +27,55 @@ on: - ".github/workflows/build.yml" jobs: - build-windows: - name: Windows x86 build - runs-on: windows-2019 - - steps: - - uses: actions/checkout@v3 - with: - clean: true - submodules: recursive - token: ${{ secrets.CI_TOKEN }} - fetch-depth: 0 - - - name: Setup Python - uses: actions/setup-python@v2 - - - name: Install CMake - uses: lukka/get-cmake@v.3.23.2 - - - name: Install latest conan - run: | - python -m pip install --upgrade pip - pip install conan - - - name: Generate build files - run: | - $env:OMP_BUILD_VERSION=$(git rev-list $(git rev-list --max-parents=0 HEAD) HEAD | Measure-Object -Line).Lines - $env:OMP_BUILD_COMMIT=$(git rev-parse HEAD) - mkdir build - cd build - cmake .. -A Win32 -T "ClangCL" - - - name: Build - run: | - cd build - cmake --build . --config RelWithDebInfo - - - name: Create a snapshot - shell: bash - env: - CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }} - HEAD_REF: ${{ github.head_ref || github.ref_name }} - run: | - version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}") - archive_name="open.mp-win-snapshot-${version}.zip" - cd build/Output/* - powershell -NoLogo -NoProfile -Command Compress-Archive -DestinationPath "${archive_name}" -Path "Server" - eval $(ssh-agent -s) - echo "${CI_PRIVATE_KEY}" | ssh-add - - echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ + # build-windows: + # name: Windows x86 build + # runs-on: windows-2019 + + # steps: + # - uses: actions/checkout@v3 + # with: + # clean: true + # submodules: recursive + # token: ${{ secrets.CI_TOKEN }} + # fetch-depth: 0 + + # - name: Setup Python + # uses: actions/setup-python@v2 + + # - name: Install CMake + # uses: lukka/get-cmake@v.3.23.2 + + # - name: Install latest conan + # run: | + # python -m pip install --upgrade pip + # pip install conan + + # - name: Generate build files + # run: | + # $env:OMP_BUILD_VERSION=$(git rev-list $(git rev-list --max-parents=0 HEAD) HEAD | Measure-Object -Line).Lines + # $env:OMP_BUILD_COMMIT=$(git rev-parse HEAD) + # mkdir build + # cd build + # cmake .. -A Win32 -T "ClangCL" + + # - name: Build + # run: | + # cd build + # cmake --build . --config RelWithDebInfo + + # - name: Create a snapshot + # shell: bash + # env: + # CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }} + # HEAD_REF: ${{ github.head_ref || github.ref_name }} + # run: | + # version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}") + # archive_name="open.mp-win-snapshot-${version}.zip" + # cd build/Output/* + # powershell -NoLogo -NoProfile -Command Compress-Archive -DestinationPath "${archive_name}" -Path "Server" + # eval $(ssh-agent -s) + # echo "${CI_PRIVATE_KEY}" | ssh-add - + # echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ build-linux-static: name: Linux x86 dynssl build From 5d387f3c9a063d0985d1f735e5e3723d5cc539e6 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 18:52:42 +0330 Subject: [PATCH 07/19] bring chwon back, run it as root --- docker/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/build.sh b/docker/build.sh index fe01d1405..49e60cc97 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -29,7 +29,8 @@ docker build \ folders=('build' 'conan') for folder in "${folders[@]}"; do if [[ ! -d "./${folder}" ]]; then - mkdir ${folder} && ls -l + mkdir ${folder} && + sudo chown 1000:1000 ${folder} || exit 1 fi done From 64aba4318b863d723f710df90839aaf1404334f1 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 19:16:57 +0330 Subject: [PATCH 08/19] disable linux static build for now --- .github/workflows/build.yml | 60 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e66dc1ffa..06bcb2e90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,40 +77,40 @@ jobs: # echo "${CI_PRIVATE_KEY}" | ssh-add - # echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ - build-linux-static: - name: Linux x86 dynssl build - runs-on: ubuntu-latest + # build-linux-static: + # name: Linux x86 dynssl build + # runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - clean: true - submodules: recursive - token: ${{ secrets.CI_TOKEN }} - fetch-depth: 0 + # steps: + # - uses: actions/checkout@v3 + # with: + # clean: true + # submodules: recursive + # token: ${{ secrets.CI_TOKEN }} + # fetch-depth: 0 - - name: Set ownership - run: | - # this is to fix GIT not liking owner of the checkout dir - chown -R $(id -u):$(id -g) $PWD + # - name: Set ownership + # run: | + # # this is to fix GIT not liking owner of the checkout dir + # chown -R $(id -u):$(id -g) $PWD - - name: Build - run: | - cd docker - CONFIG=RelWithDebInfo UBUNTU_VERSION=18.04 BUILD_SHARED=0 BUILD_SERVER=1 BUILD_TOOLS=0 ./build.sh + # - name: Build + # run: | + # cd docker + # CONFIG=RelWithDebInfo UBUNTU_VERSION=18.04 BUILD_SHARED=0 BUILD_SERVER=1 BUILD_TOOLS=0 ./build.sh - - name: Create a snapshot - env: - CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }} - HEAD_REF: ${{ github.head_ref || github.ref_name }} - run: | - version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}") - archive_name="open.mp-linux-static-snapshot-${version}.tar.xz" - cd docker/build/Output/* - tar -cJvf "${archive_name}" "Server" - eval $(ssh-agent -s) - echo "${CI_PRIVATE_KEY}" | ssh-add - - echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ + # - name: Create a snapshot + # env: + # CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }} + # HEAD_REF: ${{ github.head_ref || github.ref_name }} + # run: | + # version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}") + # archive_name="open.mp-linux-static-snapshot-${version}.tar.xz" + # cd docker/build/Output/* + # tar -cJvf "${archive_name}" "Server" + # eval $(ssh-agent -s) + # echo "${CI_PRIVATE_KEY}" | ssh-add - + # echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ build-linux: name: Linux x86 build From fdf8d5ec4fd48beb04adefe09fd35ed86a76dcc4 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 19:18:19 +0330 Subject: [PATCH 09/19] attempt to build and upload artifacts to/on github --- .github/workflows/build.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06bcb2e90..d425980c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,6 +124,14 @@ jobs: token: ${{ secrets.CI_TOKEN }} fetch-depth: 0 + - name: Declare build output variables + id: vars + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + echo "::set-output name=build_version::$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" + - name: Set ownership run: | # this is to fix GIT not liking owner of the checkout dir @@ -134,18 +142,19 @@ jobs: cd docker CONFIG=RelWithDebInfo UBUNTU_VERSION=18.04 BUILD_SHARED=1 BUILD_SERVER=1 BUILD_TOOLS=0 ./build.sh - - name: Create a snapshot + - name: Create a build archive env: - CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }} HEAD_REF: ${{ github.head_ref || github.ref_name }} run: | - version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}") + version=${{ steps.vars.outputs.build_version }} archive_name="open.mp-linux-snapshot-${version}.tar.xz" cd docker/build/Output/* tar -cJvf "${archive_name}" "Server" - eval $(ssh-agent -s) - echo "${CI_PRIVATE_KEY}" | ssh-add - - echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + path: ./docker/build/Output/open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz abi-check: if: github.event_name == 'pull_request' From c76683ee12cdb28dce3ac52fdfd66b88dcbcd1d9 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 19:29:25 +0330 Subject: [PATCH 10/19] change package name and sudo for running tar --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d425980c5..22d335e29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -147,9 +147,9 @@ jobs: HEAD_REF: ${{ github.head_ref || github.ref_name }} run: | version=${{ steps.vars.outputs.build_version }} - archive_name="open.mp-linux-snapshot-${version}.tar.xz" + archive_name="open.mp-linux-dynssl-${version}.tar.xz" cd docker/build/Output/* - tar -cJvf "${archive_name}" "Server" + sudo tar -cJvf "${archive_name}" "Server" - name: Upload build artifacts uses: actions/upload-artifact@v3 From 66d7504af5ba54be159cc081c8100066cb237060 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 19:47:58 +0330 Subject: [PATCH 11/19] run chwon as root in abischeck script --- docker/abicheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/abicheck.sh b/docker/abicheck.sh index 88606f006..aae17339c 100644 --- a/docker/abicheck.sh +++ b/docker/abicheck.sh @@ -30,7 +30,7 @@ folders=('build' 'conan') for folder in "${folders[@]}"; do if [[ ! -d "./${folder}" ]]; then mkdir ${folder} && - chown 1000:1000 ${folder} || exit 1 + sudo chown 1000:1000 ${folder} || exit 1 fi done From fc8a6e45fddd7d0b8a3af91ddca75a13cebabfb7 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 19:58:08 +0330 Subject: [PATCH 12/19] show file tree for debugging --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22d335e29..5fbd4f3e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -151,10 +151,14 @@ jobs: cd docker/build/Output/* sudo tar -cJvf "${archive_name}" "Server" + - name: show tree + run: | + tree ./ + - name: Upload build artifacts uses: actions/upload-artifact@v3 with: - path: ./docker/build/Output/open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz + path: docker/build/Output/open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz abi-check: if: github.event_name == 'pull_request' From 56976a22bfea2f641012e6afe6640ce6885b6d13 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 20:32:45 +0330 Subject: [PATCH 13/19] use new variable setting method and fix upload --- .github/workflows/build.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fbd4f3e7..b13630655 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,7 +130,12 @@ jobs: env: HEAD_REF: ${{ github.head_ref || github.ref_name }} run: | - echo "::set-output name=build_version::$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" + echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT + echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT + echo "build_ubuntu_version=18.04" >> $GITHUB_OUTPUT + echo "build_shared=1" >> $GITHUB_OUTPUT + echo "build_server=1" >> $GITHUB_OUTPUT + echo "build_tools=0" >> $GITHUB_OUTPUT - name: Set ownership run: | @@ -140,7 +145,7 @@ jobs: - name: Build run: | cd docker - CONFIG=RelWithDebInfo UBUNTU_VERSION=18.04 BUILD_SHARED=1 BUILD_SERVER=1 BUILD_TOOLS=0 ./build.sh + CONFIG=${{ steps.vars.outputs.build_config }} UBUNTU_VERSION=${{ steps.vars.outputs.build_ubuntu_version }} BUILD_SHARED=${{ steps.vars.outputs.build_shared }} BUILD_SERVER=${{ steps.vars.outputs.build_server }} BUILD_TOOLS=${{ steps.vars.outputs.build_tools }} ./build.sh - name: Create a build archive env: @@ -151,14 +156,10 @@ jobs: cd docker/build/Output/* sudo tar -cJvf "${archive_name}" "Server" - - name: show tree - run: | - tree ./ - - name: Upload build artifacts uses: actions/upload-artifact@v3 with: - path: docker/build/Output/open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz + path: docker/build/Output/${{ steps.vars.outputs.build_config }}/open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz abi-check: if: github.event_name == 'pull_request' From fc9daaf896f2d0a6c9571549adfb596c95a99e26 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 20:52:48 +0330 Subject: [PATCH 14/19] set a name for uploaded artifact --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b13630655..aa4aac0f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -159,6 +159,7 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v3 with: + name: open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }} path: docker/build/Output/${{ steps.vars.outputs.build_config }}/open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz abi-check: From 326a1ca525636d53c02e12daeffaf4dcdeb40bc1 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 20:53:02 +0330 Subject: [PATCH 15/19] throw error if artifact uploader can't find files --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa4aac0f4..80cab0272 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -161,6 +161,7 @@ jobs: with: name: open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }} path: docker/build/Output/${{ steps.vars.outputs.build_config }}/open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz + if-no-files-found: error abi-check: if: github.event_name == 'pull_request' From 612449bcc91161a7dacdebe1f117d8c4472608f4 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 20:57:23 +0330 Subject: [PATCH 16/19] bring back and update linux static ci build --- .github/workflows/build.yml | 76 ++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80cab0272..bfb3f0e72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,40 +77,56 @@ jobs: # echo "${CI_PRIVATE_KEY}" | ssh-add - # echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ - # build-linux-static: - # name: Linux x86 dynssl build - # runs-on: ubuntu-latest + build-linux-static: + name: Linux x86 dynssl build + runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # with: - # clean: true - # submodules: recursive - # token: ${{ secrets.CI_TOKEN }} - # fetch-depth: 0 + steps: + - uses: actions/checkout@v3 + with: + clean: true + submodules: recursive + token: ${{ secrets.CI_TOKEN }} + fetch-depth: 0 - # - name: Set ownership - # run: | - # # this is to fix GIT not liking owner of the checkout dir - # chown -R $(id -u):$(id -g) $PWD + - name: Declare build output variables + id: vars + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT + echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT + echo "build_ubuntu_version=18.04" >> $GITHUB_OUTPUT + echo "build_shared=0" >> $GITHUB_OUTPUT + echo "build_server=1" >> $GITHUB_OUTPUT + echo "build_tools=0" >> $GITHUB_OUTPUT - # - name: Build - # run: | - # cd docker - # CONFIG=RelWithDebInfo UBUNTU_VERSION=18.04 BUILD_SHARED=0 BUILD_SERVER=1 BUILD_TOOLS=0 ./build.sh + - name: Set ownership + run: | + # this is to fix GIT not liking owner of the checkout dir + chown -R $(id -u):$(id -g) $PWD - # - name: Create a snapshot - # env: - # CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }} - # HEAD_REF: ${{ github.head_ref || github.ref_name }} - # run: | - # version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}") - # archive_name="open.mp-linux-static-snapshot-${version}.tar.xz" - # cd docker/build/Output/* - # tar -cJvf "${archive_name}" "Server" - # eval $(ssh-agent -s) - # echo "${CI_PRIVATE_KEY}" | ssh-add - - # echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ + - name: Build + run: | + cd docker + CONFIG=${{ steps.vars.outputs.build_config }} UBUNTU_VERSION=${{ steps.vars.outputs.build_ubuntu_version }} BUILD_SHARED=${{ steps.vars.outputs.build_shared }} BUILD_SERVER=${{ steps.vars.outputs.build_server }} BUILD_TOOLS=${{ steps.vars.outputs.build_tools }} ./build.sh + + - name: Create a build archive + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + version=${{ steps.vars.outputs.build_version }} + archive_name="open.mp-linux-${version}.tar.xz" + cd docker/build/Output/* + sudo tar -cJvf "${archive_name}" "Server" + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: open.mp-linux-${{ steps.vars.outputs.build_version }} + path: docker/build/Output/${{ steps.vars.outputs.build_config }}/open.mp-linux-${{ steps.vars.outputs.build_version }}.tar.xz + if-no-files-found: error build-linux: name: Linux x86 build From ffd2f80afa06809c56e890de6ae041e5154ed559 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sat, 24 Dec 2022 21:29:34 +0330 Subject: [PATCH 17/19] bring windows ci build back --- .github/workflows/build.yml | 114 ++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfb3f0e72..917684a58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,55 +27,71 @@ on: - ".github/workflows/build.yml" jobs: - # build-windows: - # name: Windows x86 build - # runs-on: windows-2019 - - # steps: - # - uses: actions/checkout@v3 - # with: - # clean: true - # submodules: recursive - # token: ${{ secrets.CI_TOKEN }} - # fetch-depth: 0 - - # - name: Setup Python - # uses: actions/setup-python@v2 - - # - name: Install CMake - # uses: lukka/get-cmake@v.3.23.2 - - # - name: Install latest conan - # run: | - # python -m pip install --upgrade pip - # pip install conan - - # - name: Generate build files - # run: | - # $env:OMP_BUILD_VERSION=$(git rev-list $(git rev-list --max-parents=0 HEAD) HEAD | Measure-Object -Line).Lines - # $env:OMP_BUILD_COMMIT=$(git rev-parse HEAD) - # mkdir build - # cd build - # cmake .. -A Win32 -T "ClangCL" - - # - name: Build - # run: | - # cd build - # cmake --build . --config RelWithDebInfo - - # - name: Create a snapshot - # shell: bash - # env: - # CI_PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }} - # HEAD_REF: ${{ github.head_ref || github.ref_name }} - # run: | - # version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}") - # archive_name="open.mp-win-snapshot-${version}.zip" - # cd build/Output/* - # powershell -NoLogo -NoProfile -Command Compress-Archive -DestinationPath "${archive_name}" -Path "Server" - # eval $(ssh-agent -s) - # echo "${CI_PRIVATE_KEY}" | ssh-add - - # echo "put ${archive_name}" | sftp -oStrictHostKeyChecking=accept-new omp-ci@tms-server.com:snapshots/ + build-windows: + name: Windows x86 build + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v3 + with: + clean: true + submodules: recursive + token: ${{ secrets.CI_TOKEN }} + fetch-depth: 0 + + - name: Declare build output variables + id: vars + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT + echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT + echo "build_ubuntu_version=18.04" >> $GITHUB_OUTPUT + echo "build_shared=0" >> $GITHUB_OUTPUT + echo "build_server=1" >> $GITHUB_OUTPUT + echo "build_tools=0" >> $GITHUB_OUTPUT + + - name: Setup Python + uses: actions/setup-python@v2 + + - name: Install CMake + uses: lukka/get-cmake@v.3.23.2 + + - name: Install latest conan + run: | + python -m pip install --upgrade pip + pip install conan + + - name: Generate build files + run: | + $env:OMP_BUILD_VERSION=$(git rev-list $(git rev-list --max-parents=0 HEAD) HEAD | Measure-Object -Line).Lines + $env:OMP_BUILD_COMMIT=$(git rev-parse HEAD) + mkdir build + cd build + cmake .. -A Win32 -T "ClangCL" + + - name: Build + run: | + cd build + cmake --build . --config ${{ steps.vars.outputs.build_config }} + + - name: Create a build archive + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + version=${{ steps.vars.outputs.build_version }} + archive_name="open.mp-win-${version}.zip" + cd build/Output/* + powershell -NoLogo -NoProfile -Command Compress-Archive -DestinationPath "${archive_name}" -Path "Server" + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: open.mp-win-${{ steps.vars.outputs.build_version }} + path: build/Output/${{ steps.vars.outputs.build_config }}/open.mp-win-${{ steps.vars.outputs.build_version }}.zip + if-no-files-found: error build-linux-static: name: Linux x86 dynssl build From cc5fd93a57d78c0404a2abac3e112de58647084b Mon Sep 17 00:00:00 2001 From: iAmir Date: Sun, 25 Dec 2022 00:29:37 +0330 Subject: [PATCH 18/19] bump open.mp server version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23b1aac32..bfe92d574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.19) -project(open-mp LANGUAGES C CXX VERSION 0.0.10) +project(open-mp LANGUAGES C CXX VERSION 0.0.11) set_property(GLOBAL PROPERTY USE_FOLDERS ON) From 53873ff9903303f8b95ac7bd94598a5e67cac956 Mon Sep 17 00:00:00 2001 From: iAmir Date: Sun, 25 Dec 2022 00:37:33 +0330 Subject: [PATCH 19/19] add release github ci --- .github/workflows/release.yml | 190 ++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..70c59ad81 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,190 @@ +name: Build + +on: + release: + types: + - created + +jobs: + build-windows: + name: Windows x86 build + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v3 + with: + clean: true + ref: stable + submodules: recursive + token: ${{ secrets.CI_TOKEN }} + fetch-depth: 0 + + - name: Declare build output variables + id: vars + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT + echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT + echo "build_ubuntu_version=18.04" >> $GITHUB_OUTPUT + echo "build_shared=0" >> $GITHUB_OUTPUT + echo "build_server=1" >> $GITHUB_OUTPUT + echo "build_tools=0" >> $GITHUB_OUTPUT + + - name: Setup Python + uses: actions/setup-python@v2 + + - name: Install CMake + uses: lukka/get-cmake@v.3.23.2 + + - name: Install latest conan + run: | + python -m pip install --upgrade pip + pip install conan + + - name: Generate build files + run: | + $env:OMP_BUILD_VERSION=$(git rev-list $(git rev-list --max-parents=0 HEAD) HEAD | Measure-Object -Line).Lines + $env:OMP_BUILD_COMMIT=$(git rev-parse HEAD) + mkdir build + cd build + cmake .. -A Win32 -T "ClangCL" + + - name: Build + run: | + cd build + cmake --build . --config ${{ steps.vars.outputs.build_config }} + + - name: Create a build archive + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + version=${{ steps.vars.outputs.build_version }} + archive_name="open.mp-win-${version}.zip" + cd build/Output/* + powershell -NoLogo -NoProfile -Command Compress-Archive -DestinationPath "${archive_name}" -Path "Server" + + - name: Upload to release + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: build/Output/${{ steps.vars.outputs.build_config }}/open.mp-win-${{ steps.vars.outputs.build_version }}.zip + asset_name: open.mp-win-${{ steps.vars.outputs.build_version }}.zip + asset_content_type: application/gzip + + build-linux-static: + name: Linux x86 dynssl build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + clean: true + ref: stable + submodules: recursive + token: ${{ secrets.CI_TOKEN }} + fetch-depth: 0 + + - name: Declare build output variables + id: vars + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT + echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT + echo "build_ubuntu_version=18.04" >> $GITHUB_OUTPUT + echo "build_shared=0" >> $GITHUB_OUTPUT + echo "build_server=1" >> $GITHUB_OUTPUT + echo "build_tools=0" >> $GITHUB_OUTPUT + + - name: Set ownership + run: | + # this is to fix GIT not liking owner of the checkout dir + chown -R $(id -u):$(id -g) $PWD + + - name: Build + run: | + cd docker + CONFIG=${{ steps.vars.outputs.build_config }} UBUNTU_VERSION=${{ steps.vars.outputs.build_ubuntu_version }} BUILD_SHARED=${{ steps.vars.outputs.build_shared }} BUILD_SERVER=${{ steps.vars.outputs.build_server }} BUILD_TOOLS=${{ steps.vars.outputs.build_tools }} ./build.sh + + - name: Create a build archive + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + version=${{ steps.vars.outputs.build_version }} + archive_name="open.mp-linux-${version}.tar.xz" + cd docker/build/Output/* + sudo tar -cJvf "${archive_name}" "Server" + + - name: Upload to release + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: docker/build/Output/${{ steps.vars.outputs.build_config }}/open.mp-linux-${{ steps.vars.outputs.build_version }}.tar.xz + asset_name: open.mp-linux-${{ steps.vars.outputs.build_version }}.tar.xz + asset_content_type: application/gzip + + build-linux: + name: Linux x86 build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + clean: true + ref: stable + submodules: recursive + token: ${{ secrets.CI_TOKEN }} + fetch-depth: 0 + + - name: Declare build output variables + id: vars + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT + echo "build_config=RelWithDebInfo" >> $GITHUB_OUTPUT + echo "build_ubuntu_version=18.04" >> $GITHUB_OUTPUT + echo "build_shared=1" >> $GITHUB_OUTPUT + echo "build_server=1" >> $GITHUB_OUTPUT + echo "build_tools=0" >> $GITHUB_OUTPUT + + - name: Set ownership + run: | + # this is to fix GIT not liking owner of the checkout dir + chown -R $(id -u):$(id -g) $PWD + + - name: Build + run: | + cd docker + CONFIG=${{ steps.vars.outputs.build_config }} UBUNTU_VERSION=${{ steps.vars.outputs.build_ubuntu_version }} BUILD_SHARED=${{ steps.vars.outputs.build_shared }} BUILD_SERVER=${{ steps.vars.outputs.build_server }} BUILD_TOOLS=${{ steps.vars.outputs.build_tools }} ./build.sh + + - name: Create a build archive + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + version=${{ steps.vars.outputs.build_version }} + archive_name="open.mp-linux-dynssl-${version}.tar.xz" + cd docker/build/Output/* + sudo tar -cJvf "${archive_name}" "Server" + + - name: Upload to release + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: docker/build/Output/${{ steps.vars.outputs.build_config }}/open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz + asset_name: open.mp-linux-dynssl-${{ steps.vars.outputs.build_version }}.tar.xz + asset_content_type: application/gzip