meshlab/.github/workflows/CreateRelease.yml
2021-01-26 14:20:38 +01:00

422 lines
16 KiB
YAML

name: CreateRelease
on:
#[push, pull_request] #just for test release scripts
workflow_dispatch: #manual run
inputs:
version:
description: 'New MeshLab Version'
required: true
default: 'YYYY.MM'
jobs:
update_ml_version:
name: Update ML_VERSION, snapcraft.yaml and Info.plist
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
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" scripts/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
linux_build:
needs: [update_ml_version]
name: Build MeshLab (Linux)
runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version
strategy:
matrix:
precision: [single_precision, double_precision]
steps:
- uses: actions/checkout@v2
with:
ref: master
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v2
- name: Install dependencies
run: |
sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libgmp-dev
#needed by qt 5.15 on linux
sudo apt-get install libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-render-util0-dev libxcb-xinerama0-dev
- name: Setup env variables
id: envs
shell: bash
run: |
if [ "${{matrix.precision}}" == "double_precision" ]; then
echo ::set-output name=version::"$(cat ML_VERSION)d"
echo ::set-output name=artifact_suffix::"_double"
else
echo ::set-output name=version::"$(cat ML_VERSION)"
echo ::set-output name=artifact_suffix::""
fi
- name: Configure and Build
run: |
sh scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }}
- name: Deploy
run: |
sh scripts/${{ runner.os }}/2_deploy.sh
- name: Build MeshLab AppImage
run : |
sh scripts/${{ runner.os }}/3_appimage.sh --${{ matrix.precision }}
- name: Upload Meshlab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_portable${{steps.envs.outputs.artifact_suffix}}
path: src/install/
- name: Upload Meshlab AppImage
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_appimage${{steps.envs.outputs.artifact_suffix}}
path: src/MeshLab${{steps.envs.outputs.version}}-linux.AppImage
macos_build:
needs: [update_ml_version]
name: Build MeshLab (MacOS)
runs-on: macos-latest
strategy:
matrix:
precision: [single_precision, double_precision]
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
- name: Setup env variables
id: envs
shell: bash
run: |
if [ "${{matrix.precision}}" == "double_precision" ]; then
echo ::set-output name=version::"$(cat ML_VERSION)d"
echo ::set-output name=artifact_suffix::"_double"
else
echo ::set-output name=version::"$(cat ML_VERSION)"
echo ::set-output name=artifact_suffix::""
fi
- name: Configure and Build
run: |
sh scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }}
- name: Deploy
run: |
sh scripts/${{ runner.os }}/2_deploy.sh
- name: Create MeshLab DMG
run: |
sh scripts/${{ runner.os }}/3_dmg.sh --${{ matrix.precision }}
mv src/install/MeshLab${{steps.envs.outputs.version}}.dmg src/install/MeshLab${{steps.envs.outputs.version}}-macos.dmg
- name: Upload MeshLab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_macos_portable${{steps.envs.outputs.artifact_suffix}}
path: src/install/meshlab.app
- name: Upload DMG
uses: actions/upload-artifact@v1
with:
name: meshlab_macos_dmg${{steps.envs.outputs.artifact_suffix}}
path: src/install/MeshLab${{steps.envs.outputs.version}}-macos.dmg
windows_build:
needs: [update_ml_version]
name: Build MeshLab (Windows)
runs-on: windows-latest
strategy:
matrix:
precision: [single_precision, double_precision]
steps:
- uses: actions/checkout@v2
with:
ref: master
submodules: true
- name: Download Jom
run: |
Invoke-WebRequest -Uri "http://mirrors.ukfast.co.uk/sites/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 "$(Get-Location)\jom" >> GITHUB_PATH
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
- name: Setup env variables
shell: bash
id: envs
run: |
if [ "${{matrix.precision}}" == "double_precision" ]; then
echo ::set-output name=version::"$(cat ML_VERSION)d"
echo ::set-output name=artifact_suffix::"_double"
else
echo ::set-output name=version::"$(cat ML_VERSION)"
echo ::set-output name=artifact_suffix::""
fi
echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" >> $GITHUB_ENV
- name: Configure and Build
shell: bash
run: |
sh scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }}
- name: Deploy
shell: bash
run: |
sh scripts/${{ runner.os }}/2_deploy.sh
- name: NSIS script
shell: bash
run: |
sh scripts/${{ runner.os }}/resources/nsis_script.sh --${{ matrix.precision }}
- name: Create Installer
uses: joncloud/makensis-action@v1
with:
script-file: "src/install/meshlab_final.nsi"
- name: Rename Installer
shell: bash
run: |
mv src/install/MeshLab${{steps.envs.outputs.version}}.exe src/MeshLab${{steps.envs.outputs.version}}-windows.exe
- name: Uploading MeshLab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_portable${{steps.envs.outputs.artifact_suffix}}
path: src/install
- name: Upload Meshlab Installer
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_installer${{steps.envs.outputs.artifact_suffix}}
path: src/MeshLab${{steps.envs.outputs.version}}-windows.exe
#after building MeshLab for the three platforms, we create a release in github
create_release:
name: Create Release
needs: [linux_build, macos_build, windows_build]
runs-on: ubuntu-latest
steps:
#Download Linux Packages
- name: Download Linux ZIP
uses: actions/download-artifact@v1
with:
name: meshlab_linux_portable
- name: Download Linux ZIP-d
uses: actions/download-artifact@v1
with:
name: meshlab_linux_portable_double
- name: Download Linux AppImage
uses: actions/download-artifact@v1
with:
name: meshlab_linux_appimage
- name: Download Linux AppImage-d
uses: actions/download-artifact@v1
with:
name: meshlab_linux_appimage_double
- name: Change Permissions
run: |
chmod +x meshlab_linux_portable/usr/bin/meshlab
chmod +x meshlab_linux_portable/AppRun
chmod +x meshlab_linux_portable_double/usr/bin/meshlab
chmod +x meshlab_linux_portable_double/AppRun
- name: Create MeshLab Portable Linux Archive
run: |
tar -cvzf MeshLab${{ github.event.inputs.version }}-linux.tar.gz meshlab_linux_portable/
tar -cvzf MeshLab${{ github.event.inputs.version }}d-linux.tar.gz meshlab_linux_portable_double/
#Download MacOS Package
- name: Download MacOS DMG
uses: actions/download-artifact@v1
with:
name: meshlab_macos_dmg
- name: Download MacOS DMG-d
uses: actions/download-artifact@v1
with:
name: meshlab_macos_dmg_double
- name: Download MacOS Portable
uses: actions/download-artifact@v1
with:
name: meshlab_macos_portable
- name: Download MacOS Portable-d
uses: actions/download-artifact@v1
with:
name: meshlab_macos_portable_double
- name: Create MeshLab Portable MacOS
run: |
mv meshlab_macos_portable meshlab.app
zip -r MeshLab${{ github.event.inputs.version }}-macos.zip meshlab.app/
rm -r meshlab.app
mv meshlab_macos_portable_double meshlab.app
zip -r MeshLab${{ github.event.inputs.version }}d-macos.zip meshlab.app/
#Download Windows Packages
- name: Download Windows ZIP
uses: actions/download-artifact@v1
with:
name: meshlab_windows_portable
- name: Download Windows ZIP-d
uses: actions/download-artifact@v1
with:
name: meshlab_windows_portable_double
- name: Download Windows Installer
uses: actions/download-artifact@v1
with:
name: meshlab_windows_installer
- name: Download Windows Installer-d
uses: actions/download-artifact@v1
with:
name: meshlab_windows_installer_double
- name: Create MeshLab Portable Windows Archive
run: |
zip -r MeshLab${{ github.event.inputs.version }}-windows.zip meshlab_windows_portable/
zip -r MeshLab${{ github.event.inputs.version }}d-windows.zip meshlab_windows_portable_double/
#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 ReleaseLinuxPortable-d
id: upload-release-linux-portable-d
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 }}d-linux.tar.gz
asset_name: MeshLab${{ github.event.inputs.version }}d-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 ReleaseLinuxAppImage-d
id: upload-release-linux-appimage-d
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_double/MeshLab${{ github.event.inputs.version }}d-linux.AppImage
asset_name: MeshLab${{ github.event.inputs.version }}d-linux.AppImage
asset_content_type: MeshLab AppImage 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 DMG for MacOS
- name: Upload ReleaseMacOSDMG-d
id: upload-release-macos-d
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_double/MeshLab${{ github.event.inputs.version }}d-macos.dmg
asset_name: MeshLab${{ github.event.inputs.version }}d-macos.dmg
asset_content_type: MeshLab DMG for MacOS
- name: Upload ReleaseMacOSPortable
id: upload-release-macos-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 }}-macos.zip
asset_name: MeshLab${{ github.event.inputs.version }}-macos.zip
asset_content_type: MeshLab Portable for MacOS
- name: Upload ReleaseMacOSPortable-d
id: upload-release-macos-portable-d
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 }}d-macos.zip
asset_name: MeshLab${{ github.event.inputs.version }}d-macos.zip
asset_content_type: MeshLab Portable 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 ReleaseWindowsPortable-d
id: upload-release-windows-portable-d
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 }}d-windows.zip
asset_name: MeshLab${{ github.event.inputs.version }}d-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
- name: Upload ReleaseWindowsInstaller-d
id: upload-release-windows-installer-d
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_double/MeshLab${{ github.event.inputs.version }}d-windows.exe
asset_name: MeshLab${{ github.event.inputs.version }}d-windows.exe
asset_content_type: MeshLab Portable for Windows