meshlab/.github/workflows/CreateRelease.yml

366 lines
13 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
runs-on: ubuntu-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: commit ML_VERSION change
uses: stefanzweifel/git-auto-commit-action@v4.1.1
with:
commit_message: Set MeshLab version to ${{ github.event.inputs.version }}
linux_build:
needs: [update_ml_version]
name: Build MeshLab (Linux)
runs-on: ubuntu-18.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: main
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v2
- name: Install dependencies
run: |
bash scripts/${{ runner.os }}/0_setup_env_ubuntu.sh --dont_install_qt --dowload_cgal_and_boost_src
#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=artifact_suffix::"_double"
else
echo ::set-output name=artifact_suffix::""
fi
- name: Configure and Build
shell: bash
run: |
bash scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }}
- name: Deploy and AppImage
shell: bash
run: |
bash scripts/${{ runner.os }}/2_deploy_and_appimage.sh
- name: Upload Meshlab Portable
uses: actions/upload-artifact@v2
with:
name: meshlab_linux_portable${{steps.envs.outputs.artifact_suffix}}
path: install/
- name: Upload Meshlab AppImage
uses: actions/upload-artifact@v2
with:
name: meshlab_linux_appimage${{steps.envs.outputs.artifact_suffix}}
path: MeshLab*-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: main
submodules: recursive
- name: Install dependencies
run: |
brew install libomp cgal xerces-c
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=artifact_suffix::"_double"
else
echo ::set-output name=artifact_suffix::""
fi
- name: Configure and Build
shell: bash
run: |
bash scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }}
- name: Deploy
shell: bash
run: |
bash scripts/${{ runner.os }}/2_deploy.sh
- name: Import Cert and Key
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PSSW }}
- name: Sign
run: |
codesign --options "runtime" --timestamp --force --deep --sign ${{ secrets.MACOS_CERT_ID }} install/meshlab.app
- name: Notarize
uses: devbotsxyz/xcode-notarize@v1
with:
product-path: "install/meshlab.app"
appstore-connect-username: ${{ secrets.MACOS_NOTARIZATION_USER }}
appstore-connect-password: ${{ secrets.MACOS_NOTARIZATION_PSSW }}
- name: "Staple Release"
uses: devbotsxyz/xcode-staple@v1
with:
product-path: "install/meshlab.app"
- name: Create MeshLab DMG
shell: bash
run: |
bash scripts/${{ runner.os }}/3_dmg.sh
- name: Upload MeshLab Portable
uses: actions/upload-artifact@v2
with:
name: meshlab_macos_portable${{steps.envs.outputs.artifact_suffix}}
path: install/MeshLab*.app
- name: Upload DMG
uses: actions/upload-artifact@v2
with:
name: meshlab_macos_dmg${{steps.envs.outputs.artifact_suffix}}
path: install/MeshLab*-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: main
submodules: recursive
- 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=artifact_suffix::"_double"
else
echo ::set-output name=artifact_suffix::""
fi
echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC" >> $GITHUB_ENV
- name: Install wget
run: |
$env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin"
pacman.exe -S --noconfirm --noprogressbar wget unzip
- name: Set Certificate
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_CERTIFICATE }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx
- name: Download external libraries
shell: C:\shells\msys2bash.cmd {0}
run: |
bash scripts/${{ runner.os }}/0_download_ext.sh
- name: Configure and Build
shell: bash
run: |
bash scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }}
- name: Sign Portable content
run: |
.\scripts\Windows\internal\sign_dlls.ps1 -pssw '${{ secrets.WIN_CERTIFICATE_PSSW }}' -path 'src\install\'
- name: Deploy
shell: C:\shells\msys2bash.cmd {0}
run: |
bash scripts/${{ runner.os }}/2_deploy.sh
- name: NSIS script
shell: bash
run: |
bash scripts/${{ runner.os }}/internal/nsis_script.sh
- name: Create Installer
uses: joncloud/makensis-action@v1
with:
script-file: "src/install/meshlab_final.nsi"
- name: Move Installer
shell: bash
run: |
mkdir src/installer
mv src/install/MeshLab*-windows.exe src/installer
rm src/install/meshlab_final.nsi
rm src/install/ExecWaitJob.nsh
rm src/install/FileAssociation.nsh
- name: Sign Installer
run: |
.\scripts\Windows\internal\sign_dlls.ps1 -pssw '${{ secrets.WIN_CERTIFICATE_PSSW }}' -path 'src\installer\'
- name: Uploading MeshLab Portable
uses: actions/upload-artifact@v2
with:
name: meshlab_windows_portable${{steps.envs.outputs.artifact_suffix}}
path: src/install
- name: Upload Meshlab Installer
uses: actions/upload-artifact@v2
with:
name: meshlab_windows_installer${{steps.envs.outputs.artifact_suffix}}
path: src/installer/MeshLab*-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@v2
with:
name: meshlab_linux_portable
path: meshlab_linux_portable
- name: Download Linux ZIP-d
uses: actions/download-artifact@v2
with:
name: meshlab_linux_portable_double
path: meshlab_linux_portable_double
- name: Download Linux AppImage
uses: actions/download-artifact@v2
with:
name: meshlab_linux_appimage
path: meshlab_linux_appimage
- name: Download Linux AppImage-d
uses: actions/download-artifact@v2
with:
name: meshlab_linux_appimage_double
path: 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: Setup env variables
id: envs
shell: bash
run: |
#get version of meshlab
IFS=' ' #space delimiter
STR_VERSION=$(meshlab_linux_portable/usr/bin/meshlab --version)
read -a strarr <<< "$STR_VERSION"
ML_VERSION=${strarr[1]} #get the meshlab version from the string
echo ::set-output name=ml_version::"$ML_VERSION"
STR_VERSION=$(meshlab_linux_portable_double/usr/bin/meshlab --version)
read -a strarrd <<< "$STR_VERSION"
ML_VERSION_D=${strarrd[1]} #get the meshlab version from the string
echo ::set-output name=ml_version_d::"$ML_VERSION_D"
#access to this variable using ${{steps.envs.outputs.ml_version}} or ${{steps.envs.outputs.ml_version_d}}
- name: Create MeshLab Portable Linux Archive
run: |
cd meshlab_linux_portable
tar -cvzf ../MeshLab${{steps.envs.outputs.ml_version}}-linux.tar.gz *
cd ../meshlab_linux_portable_double
tar -cvzf ../MeshLab${{steps.envs.outputs.ml_version_d}}-linux.tar.gz *
cd ..
#Download MacOS Package
- name: Download MacOS DMG
uses: actions/download-artifact@v2
with:
name: meshlab_macos_dmg
path: meshlab_macos_dmg
- name: Download MacOS DMG-d
uses: actions/download-artifact@v2
with:
name: meshlab_macos_dmg_double
path: meshlab_macos_dmg_double
- name: Download MacOS Portable
uses: actions/download-artifact@v2
with:
name: meshlab_macos_portable
path: meshlab_macos_portable
- name: Download MacOS Portable-d
uses: actions/download-artifact@v2
with:
name: meshlab_macos_portable_double
path: meshlab_macos_portable_double
- name: Change Permissions
run: |
chmod +x meshlab_macos_portable/MeshLab*.app/Contents/MacOS/meshlab
chmod +x meshlab_macos_portable_double/MeshLab*.app/Contents/MacOS/meshlab
- name: Create MeshLab Portable MacOS
run: |
cd meshlab_macos_portable
tar -cvzf ../MeshLab${{steps.envs.outputs.ml_version}}-macos.tar.gz *
cd ../meshlab_macos_portable_double
tar -cvzf ../MeshLab${{steps.envs.outputs.ml_version_d}}-macos.tar.gz *
cd ..
#Download Windows Packages
- name: Download Windows ZIP
uses: actions/download-artifact@v2
with:
name: meshlab_windows_portable
path: meshlab_windows_portable
- name: Download Windows ZIP-d
uses: actions/download-artifact@v2
with:
name: meshlab_windows_portable_double
path: meshlab_windows_portable_double
- name: Download Windows Installer
uses: actions/download-artifact@v2
with:
name: meshlab_windows_installer
path: meshlab_windows_installer
- name: Download Windows Installer-d
uses: actions/download-artifact@v2
with:
name: meshlab_windows_installer_double
path: meshlab_windows_installer_double
- name: Create MeshLab Portable Windows Archive
run: |
cd meshlab_windows_portable
zip -r ../MeshLab${{steps.envs.outputs.ml_version}}-windows.zip *
cd ../meshlab_windows_portable_double
zip -r ../MeshLab${{steps.envs.outputs.ml_version_d}}-windows.zip *
cd ..
#Create release and upload
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "MeshLab-${{steps.envs.outputs.ml_version}}"
prerelease: false #${{ github.event.inputs.release_candidate }}
title: "MeshLab-${{steps.envs.outputs.ml_version}}"
files: |
MeshLab${{steps.envs.outputs.ml_version}}-linux.tar.gz
MeshLab${{steps.envs.outputs.ml_version_d}}-linux.tar.gz
meshlab_linux_appimage/MeshLab${{steps.envs.outputs.ml_version}}-linux.AppImage
meshlab_linux_appimage_double/MeshLab${{steps.envs.outputs.ml_version_d}}-linux.AppImage
MeshLab${{steps.envs.outputs.ml_version}}-macos.tar.gz
MeshLab${{steps.envs.outputs.ml_version_d}}-macos.tar.gz
meshlab_macos_dmg/MeshLab${{steps.envs.outputs.ml_version}}-macos.dmg
meshlab_macos_dmg_double/MeshLab${{steps.envs.outputs.ml_version_d}}-macos.dmg
MeshLab${{steps.envs.outputs.ml_version}}-windows.zip
MeshLab${{steps.envs.outputs.ml_version_d}}-windows.zip
meshlab_windows_installer/MeshLab${{steps.envs.outputs.ml_version}}-windows.exe
meshlab_windows_installer_double/MeshLab${{steps.envs.outputs.ml_version_d}}-windows.exe