meshlab/.github/workflows/CreateRelease.yml
2020-10-14 11:09:20 +02:00

360 lines
13 KiB
YAML

name: BuildAndRelease
on:
#[push, pull_request] #just for test release scripts
workflow_dispatch: #manual run
inputs:
version:
description: 'New MeshLab Version'
required: true
default: 'YYYY.MM'
#schedule:
# - cron: '0 1 1 * *' #every first day of the month at 1am
jobs:
update_ml_version:
name: Update ML_VERSION, snapcraft.yaml and Info.plist
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
submodules: true
- name: Update MeshLab version
run : |
echo ${{ github.event.inputs.version }} | tr -d '\n'> ML_VERSION
- name: Update Info.plist
run: |
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString ${{ github.event.inputs.version }}" src/meshlab/Info.plist
/usr/libexec/PlistBuddy -c "Set CFBundleVersion ${{ github.event.inputs.version }}" src/meshlab/Info.plist
- name: Update Snap file
run: |
sed "s%MESHLAB_VERSION%$(cat ML_VERSION)%g" install/linux/resources/snap/snap_noversion.yaml > snapcraft.yaml
- name: commit ML_VERSION, snapcraft.yaml and Info.plist change
uses: stefanzweifel/git-auto-commit-action@v4.1.1
with:
commit_message: Apply automatic ML_VERSION, snapcraft.yaml and Info.plist change
ubuntu_build_appimage:
needs: [update_ml_version]
name: Build MeshLab (Ubuntu - AppImage)
runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version
steps:
- uses: actions/checkout@v2
with:
ref: master
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Install dependencies
run: |
sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev
sudo apt-get install -y libxkbcommon-x11-0 patchelf
- name: Setup env variables
id: envs
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Build MeshLab
run: |
sh install/linux/qmake/linux_build.sh
- name: Make MeshLab Bundle
run: |
sh install/linux/qmake/linux_make_bundle.sh
- name: Deploy MeshLab and MeshLabServer
run : |
sh install/linux/qmake/linux_deploy.sh
- name: Build MeshLab and MeshLabServer AppImages
run : |
sh install/linux/qmake/linux_appimages.sh
- 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
ubuntu_build_snap:
needs: [update_ml_version]
name: Build MeshLab (Ubuntu - Snap)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
submodules: true
- name: Install dependencies
run: |
#needed for some reason...
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
sudo apt update
sudo apt-get install -y snapcraft
- name: Setup env variables
id: envs
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Build MeshLab Snap
run: |
snapcraft
- name: Rename Snap
run: |
mv ./meshlab*.snap ./MeshLab${{steps.envs.outputs.date}}-linux.snap
- name: Upload Meshlab Snap
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_snap
path: MeshLab${{steps.envs.outputs.date}}-linux.snap
macos_build:
needs: [update_ml_version]
name: Build MeshLab (MacOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
submodules: true
- name: Install dependencies
run: |
brew install libomp
npm install -g appdmg
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Setup env variables
id: envs
shell: bash
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- 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
with:
ref: master
submodules: true
- name: Download 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 "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" >> $GITHUB_ENV
#echo '::set-env name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
echo "::set-output name=date::$(type ML_VERSION)"
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Build MeshLab
run: |
.\install\windows\windows_build.ps1
- 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_appimage, ubuntu_build_snap, macos_build, windows_build]
runs-on: ubuntu-latest
steps:
#- name: Setup env variables
# id: envs
# run: |
# echo ::set-output name=date::"$(date +%Y.%m)"
#Linux Release
- name: Download Linux ZIP
uses: actions/download-artifact@v1
with:
name: 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: Download Linux Snap
uses: actions/download-artifact@v1
with:
name: meshlab_linux_snap
- name: Change Permissions
run: |
chmod +x meshlab_linux_portable/usr/bin/meshlab
chmod +x meshlab_linux_portable/usr/bin/meshlabserver
chmod +x meshlab_linux_portable/AppRun
chmod +x meshlab_linux_appimage/MeshLab${{ github.event.inputs.version }}-linux.AppImage
chmod +x meshlabserver_linux_appimage/MeshLabServer${{ github.event.inputs.version }}-linux.AppImage
- name: Create MeshLab Portable Linux Archive
run: |
tar -cvzf MeshLab${{ github.event.inputs.version }}-linux.tar.gz meshlab_linux_portable/
#MacOS Release
- name: Download MacOS DMG
uses: actions/download-artifact@v1
with:
name: meshlab_macos_dmg
#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 Windows Archive
run: |
zip -r MeshLab${{ github.event.inputs.version }}-windows.zip meshlab_windows_portable/
#Create release and upload
- name: Publish Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: Meshlab-${{ github.event.inputs.version }}
release_name: MeshLab-${{ github.event.inputs.version }}
draft: false
prerelease: false
#Linux
- 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${{ github.event.inputs.version }}-linux.tar.gz
asset_name: MeshLab${{ github.event.inputs.version }}-linux.tar.gz
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${{ github.event.inputs.version }}-linux.AppImage
asset_name: MeshLab${{ github.event.inputs.version }}-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${{ github.event.inputs.version }}-linux.AppImage
asset_name: MeshLabServer${{ github.event.inputs.version }}-linux.AppImage
asset_content_type: MeshLabServer AppImage for Linux
- name: Upload ReleaseLinuxSnap
id: upload-release-linux-snap
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_snap/MeshLab${{ github.event.inputs.version }}-linux.snap
asset_name: MeshLab${{ github.event.inputs.version }}-linux.snap
asset_content_type: MeshLab Snap for Linux
#MacOS
- 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${{ github.event.inputs.version }}-macos.dmg
asset_name: MeshLab${{ github.event.inputs.version }}-macos.dmg
asset_content_type: MeshLab for MacOS
#Windows
- 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${{ github.event.inputs.version }}-windows.zip
asset_name: MeshLab${{ github.event.inputs.version }}-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${{ github.event.inputs.version }}-windows.exe
asset_name: MeshLab${{ github.event.inputs.version }}-windows.exe
asset_content_type: MeshLab Portable for Windows