name: CompileAndRelease on: #[push, pull_request] #just for test release scripts schedule: - cron: '0 0 1 * *' #every first day of the month at midnight jobs: update_ml_version: name: Update ML_VERSION runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Checkout submodules shell: bash run: | auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Setup env variables id: envs run: | echo ::set-output name=date::"$(date +%Y.%m)" - name: Update MeshLab version run : | echo ${{steps.envs.outputs.date}} | tr -d '\n'> ML_VERSION - name: commit ML_VERSION change uses: stefanzweifel/git-auto-commit-action@v4.1.1 with: commit_message: Apply automatic ML_VERSION change ubuntu_build: needs: [update_ml_version] name: Build MeshLab (Ubuntu) runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version steps: - uses: actions/checkout@v2 - name: Checkout submodules shell: bash run: | auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Install dependencies run: | sh install/linux/linux_setup_env_ubuntu.sh - name: Setup env variables id: envs run: | echo ::set-output name=date::"$(date +%Y.%m)" - name: Build MeshLab run: | sh install/linux/linux_build.sh - name: Deploy MeshLabServer run : | sh install/linux/linux_meshlabserver_appimage.sh - name: Deploy MeshLab run : | sh install/linux/linux_appimage.sh mv distrib/*.AppImage . - name: Upload Meshlab Portable uses: actions/upload-artifact@v1 with: name: meshlab_linux_portable path: distrib/ - name: Upload MeshlabServer AppImage uses: actions/upload-artifact@v1 with: name: meshlabserver_linux_appimage path: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage - name: Upload Meshlab AppImage uses: actions/upload-artifact@v1 with: name: meshlab_linux_appimage path: MeshLab${{steps.envs.outputs.date}}-linux.AppImage macos_build: needs: [update_ml_version] name: Build MeshLab (MacOS) runs-on: macos steps: - uses: actions/checkout@v2 - name: Checkout submodules shell: bash run: | auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Install dependencies run: | brew install llvm libomp qt npm install -g appdmg - name: Setup env variables id: envs shell: bash run: | #sh install/macos/macos_setup_env.sh #necessary here on github actions: 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}}' echo ::set-output name=date::"$(date +%Y.%m)" - name: Build MeshLab run: | sh install/macos/macos_build.sh - name: Deploy MeshLab run: | sh install/macos/macos_deploy.sh - name: Create DMG run: | sh install/macos/macos_dmg.sh mv distrib/MeshLab${{steps.envs.outputs.date}}.dmg distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg - name: Upload DMG uses: actions/upload-artifact@v1 with: name: meshlab_macos_dmg path: distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg windows_build: needs: [update_ml_version] name: Build MeshLab (Windows) runs-on: windows-latest steps: - uses: actions/checkout@v2 - name: Checkout submodules shell: bash run: | auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Downlaod Jom run: | Invoke-WebRequest -Uri "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" -OutFile "jom_1_1_3.zip" New-Item -Name "jom" -ItemType "directory" Expand-Archive -Path jom_1_1_3.zip -DestinationPath .\jom echo "::add-path::$(Get-Location)\jom" - name: Setup env variables id: envs run: | echo '::set-env name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC' echo "::set-output name=date::$(Get-Date -Format "yyyy.MM")" - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Install Qt uses: jurplel/install-qt-action@v2 with: modules: qtscript xmlpatterns #mirror: 'http://mirrors.ocf.berkeley.edu/qt/' - name: Build MeshLab run: | cd src\ qmake jom -j4 #Qt nmake for parallel build - name: Deploy MeshLab run: | .\install\windows\windows_deploy.ps1 - name: NSIS script run: | .\install\windows\resources\windows_nsis_script.ps1 - name: Create Installer uses: joncloud/makensis-action@v1 with: script-file: "install/windows/resources/meshlab_final.nsi" - name: Rename Installer run: | Rename-Item -Path install\windows\resources\MeshLab${{steps.envs.outputs.date}}.exe -NewName MeshLab${{steps.envs.outputs.date}}-windows.exe - name: Upload Meshlab Portable uses: actions/upload-artifact@v1 with: name: meshlab_windows_portable path: distrib - name: Upload Meshlab Installer uses: actions/upload-artifact@v1 with: name: meshlab_windows_installer path: install/windows/resources/MeshLab${{steps.envs.outputs.date}}-windows.exe #after building MeshLab for the three platforms, we create a release in github create_release: name: Create Release needs: [ubuntu_build, macos_build, windows_build] runs-on: ubuntu-latest steps: - name: Setup env variables id: envs run: | echo ::set-output name=date::"$(date +%Y.%m)" - name: Publish Release id: create_release uses: actions/create-release@v1.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: Meshlab-${{steps.envs.outputs.date}} release_name: MeshLab-${{steps.envs.outputs.date}} draft: false prerelease: false #Linux Release - name: Download Linux ZIP uses: actions/download-artifact@v1 with: name: meshlab_linux_portable - name: Create Meshlab Linux Archive run: | zip -r MeshLab${{steps.envs.outputs.date}}-linux.zip meshlab_linux_portable/ - name: Download Linux AppImage uses: actions/download-artifact@v1 with: name: meshlab_linux_appimage - name: Download Linux MeshLabServer AppImage uses: actions/download-artifact@v1 with: name: meshlabserver_linux_appimage - name: Upload ReleaseLinuxPortable id: upload-release-linux-portable uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: MeshLab${{steps.envs.outputs.date}}-linux.zip asset_name: MeshLab${{steps.envs.outputs.date}}-linux.zip asset_content_type: MeshLab Portable for Linux - name: Upload ReleaseLinuxAppImage id: upload-release-linux-appimage uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: meshlab_linux_appimage/MeshLab${{steps.envs.outputs.date}}-linux.AppImage asset_name: MeshLab${{steps.envs.outputs.date}}-linux.AppImage asset_content_type: MeshLab AppImage for Linux - name: Upload ReleaseLinuxMeshLabServerAppImage id: upload-release-linux-meshlabserver-appimage uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: meshlabserver_linux_appimage/MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage asset_name: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage asset_content_type: MeshLabServer AppImage for Linux #MacOS Release - name: Download MacOS DMG uses: actions/download-artifact@v1 with: name: meshlab_macos_dmg - name: Upload ReleaseMacOSDMG id: upload-release-macos uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: meshlab_macos_dmg/MeshLab${{steps.envs.outputs.date}}-macos.dmg asset_name: MeshLab${{steps.envs.outputs.date}}-macos.dmg asset_content_type: MeshLab for MacOS #Windows Release - name: Download Windows ZIP uses: actions/download-artifact@v1 with: name: meshlab_windows_portable - name: Download Windows Installer uses: actions/download-artifact@v1 with: name: meshlab_windows_installer - name: Create Meshlab Portable Archive run: | zip -r MeshLab${{steps.envs.outputs.date}}-windows.zip meshlab_windows_portable/ - name: Upload ReleaseWindowsPortable id: upload-release-windows-portable uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: MeshLab${{steps.envs.outputs.date}}-windows.zip asset_name: MeshLab${{steps.envs.outputs.date}}-windows.zip asset_content_type: MeshLab Portable for Windows - name: Upload ReleaseWindowsInstaller id: upload-release-windows-installer uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: meshlab_windows_installer/MeshLab${{steps.envs.outputs.date}}-windows.exe asset_name: MeshLab${{steps.envs.outputs.date}}-windows.exe asset_content_type: MeshLab Portable for Windows