From bfa1bbc440ddab8daab1c573f5193444396b833e Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 4 Dec 2019 17:28:52 +0100 Subject: [PATCH] github actions for ubuntu and macos added --- .github/workflows/CompileAndDeploy.yml | 127 ++++++++++++++++++++++++ .github/workflows/CompileMacOS.yml | 49 +++++++++ .github/workflows/CompileUbuntu.yml | 38 +++++++ .github/workflows/ubuntu-latest-gcc.yml | 40 -------- 4 files changed, 214 insertions(+), 40 deletions(-) create mode 100755 .github/workflows/CompileAndDeploy.yml create mode 100755 .github/workflows/CompileMacOS.yml create mode 100755 .github/workflows/CompileUbuntu.yml delete mode 100644 .github/workflows/ubuntu-latest-gcc.yml diff --git a/.github/workflows/CompileAndDeploy.yml b/.github/workflows/CompileAndDeploy.yml new file mode 100755 index 0000000000..f4a7dc5429 --- /dev/null +++ b/.github/workflows/CompileAndDeploy.yml @@ -0,0 +1,127 @@ +name: CompileAndDeploy + +on: + schedule: + - cron: '0 0 1 * *' #every first day of the month at midnight + +jobs: + ubuntu_build: + name: Build MeshLab (Ubuntu) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Installing dependencies + run: | + sudo add-apt-repository ppa:beineri/opt-qt-5.12.0-bionic -y + sudo apt update + sudo apt install -y qt512base qt512script qt512xmlpatterns mesa-common-dev libglu1-mesa-dev + cd .. + git clone --depth=1 --branch=devel https://github.com/cnr-isti-vclab/vcglib.git + cd meshlab + - name: Setting env variables + shell: bash + run: | + echo '::set-env name=QT_BASE_DIR::/opt/qt512' + echo '::set-env name=QTDIR::/opt/qt512' + echo '::add-path::/opt/qt512/bin' + echo '::set-env name=LD_LIBRARY_PATH::/opt/qt512/lib/x86_64-linux-gnu:/opt/qt512/lib:${{env.LD_LIBRARY_PATH}}' + echo '::set-env name=PKG_CONFIG_PATH::/opt/qt512/lib/pkgconfig:${{env.PKG_CONFIG_PATH}}' + - name: Compiling external + run: | + cd src/external + qmake external.pro + make -j8 + - name: Compiling meshlab + run: | + cd src/ + qmake meshlab_full.pro + make -j8 + + macos_build: + name: Build MeshLab (MacOS) + runs-on: macos + + steps: + - uses: actions/checkout@v1 + - name: Installing dependencies + run: | + brew install llvm libomp qt + npm install -g appdmg + export COLUMNS=80 + cd .. + git clone --depth=1 --branch=devel https://github.com/cnr-isti-vclab/vcglib.git + cd meshlab + - name: Setting env variables + shell: bash + run: | + echo '::set-env name=QTDIR::/usr/local/opt/qt' + echo '::add-path::/usr/local/opt/qt/bin' + echo '::set-env name=LD_LIBRARY_PATH::/usr/local/opt/qt/lib:${{env.LD_LIBRARY_PATH}}' + echo '::set-env name=PKG_CONFIG_PATH::/usr/local/opt/qt/lib:${{env.PKG_CONFIG_PATH}}' + - name: Compiling external + run: | + cd src/external + qmake external.pro + make -j8 + - name: Compiling meshlab + run: | + cd src/ + qmake meshlab_full.pro + make -j8 + - name: Creating DMG + run: | + cd src/install/macx + ./macinstall_v2018.sh + echo "------ Completed!!! We should have a dmg here " + cd ../../.. + ls -la src/distrib/MeshLab201804.dmg + - name: Upload DMG + uses: actions/upload-artifact@v1 + with: + name: meshlab_dmg + path: src/distrib/MeshLab201804.dmg + + create_prerelease: + name: Create Prerelease + needs: [ubuntu_build, macos_build] + runs-on: ubuntu-latest + steps: + - name: Setting env variables + id: envs + run: | + echo ::set-output name=date::"$(date +%Y-%m)" + - name: Publish PreRelease + id: create_prerelease + uses: actions/create-release@v1.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: Meshlab-${{steps.envs.outputs.date}}-${{github.sha}} + release_name: MeshLab-${{steps.envs.outputs.date}}-beta + draft: false + prerelease: true + - name: Download DMG + uses: actions/download-artifact@v1 + with: + name: meshlab_dmg + - name: Upload PreReleaseMacOS + id: upload-prerelease-macos + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_prerelease.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: meshlab_dmg/MeshLab201804.dmg + asset_name: MeshLab201804.dmg + asset_content_type: MeshLab for MacOS +# - name: Upload PreReleaseUbuntu +# id: upload-prerelease-ubuntu +# uses: actions/upload-release-asset@v1.0.1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ steps.create_prerelease.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps +# asset_path: src/distrib/MeshLab201804.dmg +# asset_name: MeshLab201804.dmg +# asset_content_type: MeshLab for MacOS diff --git a/.github/workflows/CompileMacOS.yml b/.github/workflows/CompileMacOS.yml new file mode 100755 index 0000000000..629cf8720d --- /dev/null +++ b/.github/workflows/CompileMacOS.yml @@ -0,0 +1,49 @@ +name: CompileMacOS + +on: + [push, pull_request] + +jobs: + macos_build: + name: Build MeshLab (MacOS) + runs-on: macos + + steps: + - uses: actions/checkout@v1 + - name: Installing dependencies + run: | + brew install llvm libomp qt + npm install -g appdmg + export COLUMNS=80 + cd .. + git clone --depth=1 --branch=devel https://github.com/cnr-isti-vclab/vcglib.git + cd meshlab + - name: Setting env variables + shell: bash + run: | + echo '::set-env name=QTDIR::/usr/local/opt/qt' + echo '::add-path::/usr/local/opt/qt/bin' + echo '::set-env name=LD_LIBRARY_PATH::/usr/local/opt/qt/lib:${{env.LD_LIBRARY_PATH}}' + echo '::set-env name=PKG_CONFIG_PATH::/usr/local/opt/qt/lib:${{env.PKG_CONFIG_PATH}}' + - name: Compiling external + run: | + cd src/external + qmake external.pro + make -j8 + - name: Compiling meshlab + run: | + cd src/ + qmake meshlab_full.pro + make -j8 + - name: Creating DMG + run: | + cd src/install/macx + ./macinstall_v2018.sh + echo "------ Completed!!! We should have a dmg here " + cd ../../.. + ls -la src/distrib/MeshLab201804.dmg + - name: Upload DMG + uses: actions/upload-artifact@v1 + with: + name: meshlab_dmg + path: src/distrib/MeshLab201804.dmg diff --git a/.github/workflows/CompileUbuntu.yml b/.github/workflows/CompileUbuntu.yml new file mode 100755 index 0000000000..9b5483543c --- /dev/null +++ b/.github/workflows/CompileUbuntu.yml @@ -0,0 +1,38 @@ +name: CompileUbuntu + +on: + [push, pull_request] + +jobs: + ubuntu_build: + name: Build MeshLab (Ubuntu) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Installing dependencies + run: | + sudo add-apt-repository ppa:beineri/opt-qt-5.12.0-bionic -y + sudo apt update + sudo apt install -y qt512base qt512script qt512xmlpatterns mesa-common-dev libglu1-mesa-dev + cd .. + git clone --depth=1 --branch=devel https://github.com/cnr-isti-vclab/vcglib.git + cd meshlab + - name: Setting env variables + shell: bash + run: | + echo '::set-env name=QT_BASE_DIR::/opt/qt512' + echo '::set-env name=QTDIR::/opt/qt512' + echo '::add-path::/opt/qt512/bin' + echo '::set-env name=LD_LIBRARY_PATH::/opt/qt512/lib/x86_64-linux-gnu:/opt/qt512/lib:${{env.LD_LIBRARY_PATH}}' + echo '::set-env name=PKG_CONFIG_PATH::/opt/qt512/lib/pkgconfig:${{env.PKG_CONFIG_PATH}}' + - name: Compiling external + run: | + cd src/external + qmake external.pro + make -j8 + - name: Compiling meshlab + run: | + cd src/ + qmake meshlab_full.pro + make -j8 diff --git a/.github/workflows/ubuntu-latest-gcc.yml b/.github/workflows/ubuntu-latest-gcc.yml deleted file mode 100644 index 7f9cc3b72b..0000000000 --- a/.github/workflows/ubuntu-latest-gcc.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: UbuntuLatestGCC - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Installing dependencies - run: | - sudo add-apt-repository ppa:beineri/opt-qt-5.12.0-bionic -y - sudo apt update - sudo apt install -y qt512base qt512script qt512xmlpatterns mesa-common-dev libglu1-mesa-dev - cd .. - git clone --depth=1 --branch=devel https://github.com/cnr-isti-vclab/vcglib.git - cd meshlab - - name: Compiling external - run: | - export QT_BASE_DIR=/opt/qt512 - export QTDIR=$QT_BASE_DIR - export PATH=$QT_BASE_DIR/bin:$PATH - export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH - export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH - cd src/external - qmake external.pro - make -j4 - - name: Compiling meshlab - run: | - #need to reset the qt env variables here... - export QT_BASE_DIR=/opt/qt512 - export QTDIR=$QT_BASE_DIR - export PATH=$QT_BASE_DIR/bin:$PATH - export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH - export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH - cd src/ - qmake meshlab_full.pro - make -j4