Update GitHub URL in VMTK.cmake #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CemrgApp Build & Deploy | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
Variables: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.vars.outputs.tag }} | ||
sha: ${{ steps.vars.outputs.sha }} | ||
steps: | ||
- name: Prepare variables | ||
id: vars | ||
run: | | ||
echo ::set-output name=tag::${GITHUB_REF#refs/tags/} | ||
echo ::set-output name=sha::${GITHUB_SHA::7} | ||
Variables: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.vars.outputs.tag }} | ||
sha: ${{ steps.vars.outputs.sha }} | ||
steps: | ||
- name: Prepare variables | ||
id: vars | ||
run: | | ||
echo ::set-output name=tag::${GITHUB_REF#refs/tags/} | ||
echo ::set-output name=sha::${GITHUB_SHA::7} | ||
Create-Release: | ||
runs-on: ubuntu-latest | ||
needs: [Variables, Build-Linux, Build-Windows, Build-macOS] | ||
steps: | ||
- name: Download packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: Packages-* | ||
merge-multiple: true | ||
- name: Upload Linux package | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: CemrgApp-Linux.zip | ||
asset_name: CemrgApp-Linux-${{ needs.Variables.outputs.tag }}.zip | ||
asset_content_type: application/zip | ||
- name: Upload Windows package | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: CemrgApp-Windows.zip | ||
asset_name: CemrgApp-Windows-${{ needs.Variables.outputs.tag }}.zip | ||
asset_content_type: application/zip | ||
- name: Upload macOS package | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: CemrgApp-macOS.dmg | ||
asset_name: CemrgApp-macOS-${{ needs.Variables.outputs.tag }}.dmg | ||
asset_content_type: application/octet-stream | ||
Build-Linux: | ||
runs-on: ubuntu-20.04 | ||
needs: [Variables] | ||
steps: | ||
- name: Download precompiled Build folder | ||
run: | | ||
wget -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/ETN8L5OcVupGiMInP8o9MtUBNflJb57nK1Dg-jnikW0iwg?download=1 | ||
7z x Build.zip | ||
rm Build.zip | ||
sudo mv Build / | ||
- name: Download external libraries | ||
run: | | ||
wget -q -O Externals.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EX8zGabE-ctDoBnde6ntHR0Bx_1wYis_ql26aAzMoedMzg?download=1 | ||
7z x Externals.zip | ||
rm Externals.zip | ||
sudo mv Externals / | ||
- name: Install missing packages | ||
run: | | ||
sudo apt update | ||
sudo DEBIAN_FRONTEND=noninteractive apt install doxygen graphviz libfreetype6-dev libglu1-mesa-dev libssl-dev libtiff5-dev libwrap0-dev libxcomposite1 libxcursor1 libxi-dev libxkbcommon-x11-0 libxt-dev mesa-common-dev -y | ||
sudo apt remove --auto-remove icu-devtools libicu-dev -y | ||
- name: Install Qt | ||
run: | | ||
sudo pip3 install --upgrade setuptools | ||
sudo pip3 install aqtinstall | ||
sudo aqt install --outputdir /Qt 5.12.10 linux desktop -m qtcharts qtnetworkauth qtpurchasing qtdatavis3d qtscript qtvirtualkeyboard qtwebengine qtwebglplugin | ||
- name: Clone MITK | ||
run: sudo git clone --branch v2022.10 https://phabricator.mitk.org/source/mitk.git /MITK | ||
- name: Change timestamps of the MITK directory | ||
run: sudo find /MITK/ -exec touch -a -m -d 20210401 {} \; | ||
- name: Clone CemrgApp | ||
uses: actions/checkout@v4 | ||
with: | ||
path: CemrgApp | ||
- name: Move CemrgApp to root | ||
run: sudo mv CemrgApp / | ||
- name: Update the CemrgApp version | ||
working-directory: /CemrgApp | ||
run: | | ||
sudo rm CemrgApp/Applications/MainApp/version.txt | ||
sudo echo ${{ needs.Variables.outputs.tag }} >> CemrgApp/Applications/MainApp/version.txt | ||
sudo echo ${{ needs.Variables.outputs.sha }} >> CemrgApp/Applications/MainApp/version.txt | ||
- name: Build | ||
working-directory: /Build | ||
run: make -j4 | ||
- name: Package | ||
working-directory: /Build/MITK-build | ||
run: | | ||
make package -j4 | ||
cd _CPack_Packages/Linux/TGZ | ||
mv MITK-v2022.10-linux-x86_64 CemrgApp-Linux | ||
rm CemrgApp-Linux/Mitk* | ||
rm CemrgApp-Linux/bin/MitkWorkbench* | ||
mv /Externals/* CemrgApp-Linux/bin/ | ||
mv /CemrgApp/README.md CemrgApp-Linux/ | ||
7z a CemrgApp-Linux.zip CemrgApp-Linux | ||
mv CemrgApp-Linux.zip ${{ github.workspace }}/ | ||
- name: Upload package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Packages-Linux | ||
path: CemrgApp-Linux.zip | ||
Build-Windows: | ||
runs-on: windows-2016 | ||
needs: [Variables] | ||
steps: | ||
- name: Uninstall NSIS | ||
run: | | ||
& 'C:/Program Files (x86)/NSIS/uninst-nsis.exe' /S | ||
- name: Download precompiled Build folder | ||
working-directory: c:\ | ||
run: | | ||
c:\msys64\usr\bin\wget.exe -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EXJ2fam5aCNLvRW8kk1o6jwBzsI50I0iuZ1vfq4oOPRbJQ?download=1 | ||
7z x Build.zip | ||
del Build.zip | ||
- name: Download external libraries | ||
working-directory: c:\ | ||
run: | | ||
c:\msys64\usr\bin\wget.exe -q -O Externals.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/Ea8urj-xMS5CoEnt3lS-A9QBLoAi1EXfP3lM26MRn11OrA?download=1 | ||
7z x Externals.zip | ||
del Externals.zip | ||
- name: Install Qt | ||
working-directory: c:\ | ||
run: | | ||
pip install aqtinstall | ||
mkdir Qt | ||
python -m aqt install --outputdir Qt 5.12.10 windows desktop win64_msvc2017_64 -m qtcharts qtnetworkauth qtpurchasing qtdatavis3d qtscript qtvirtualkeyboard qtwebengine qtwebglplugin | ||
- name: Clone MITK | ||
run: git clone --branch v2022.10 https://phabricator.mitk.org/source/mitk.git c:\MITK | ||
- name: Change timestamps of the MITK directory | ||
run: dir -R c:\MITK | foreach { $_.LastWriteTime = [DateTime]::ParseExact('01-04-21', 'dd-MM-yy', $null) } | ||
- name: Clone CemrgApp | ||
uses: actions/checkout@v4 | ||
with: | ||
path: CemrgApp | ||
- name: Copy CemrgApp to root | ||
shell: cmd | ||
run: | | ||
mkdir c:\CemrgApp | ||
xcopy /e .\CemrgApp\* c:\CemrgApp\ | ||
rd /s /q CemrgApp | ||
- name: Update the CemrgApp version | ||
working-directory: c:\CemrgApp | ||
shell: powershell | ||
run: | | ||
rm CemrgApp/Applications/MainApp/version.txt | ||
echo ${{ needs.Variables.outputs.tag }} >> CemrgApp/Applications/MainApp/version.txt | ||
echo ${{ needs.Variables.outputs.sha }} >> CemrgApp/Applications/MainApp/version.txt | ||
- name: Add MSBuild to PATH | ||
uses: microsoft/[email protected] | ||
- name: Build | ||
working-directory: c:\Build | ||
run: MSBuild MITK-superbuild.sln /p:Configuration=Release /p:Platform=x64 -m:4 | ||
- name: Package | ||
working-directory: c:\Build\MITK-build | ||
run: | | ||
MSBuild PACKAGE.vcxproj /p:Configuration=Release /p:Platform=x64 -m:4 | ||
cd _CPack_Packages\win64\ZIP | ||
ren MITK-v2022.10-windows-x86_64 CemrgApp-Windows | ||
xcopy /e c:\Externals\* .\CemrgApp-Windows\bin\ | ||
copy c:\CemrgApp\README.md .\CemrgApp-Windows\ | ||
del CemrgApp-Windows\Mitk* | ||
del CemrgApp-Windows\bin\MitkWorkbench.* | ||
7z a CemrgApp-Windows.zip CemrgApp-Windows | ||
move CemrgApp-Windows.zip ${{ github.workspace }}\ | ||
- name: Upload package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Packages-Windows | ||
path: CemrgApp-Windows.zip | ||
Build-macOS: | ||
runs-on: macos-12 | ||
needs: [Variables] | ||
steps: | ||
- name: Download precompiled Build folder | ||
working-directory: /Users/Shared | ||
run: | | ||
wget -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EX4dERE2ilFNmuv2Od0GaOoBuUSgzBS_TzwEqf9KVtmsXQ?download=1 | ||
7z x Build.zip | ||
rm Build.zip | ||
- name: Download external libraries | ||
working-directory: /Users/Shared | ||
run: | | ||
wget -q -O Externals.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EZh5YUHzdyNEu_m0ZwTfaYUBZBil9eIqLrmJw8lDWQSLag?download=1 | ||
7z x Externals.zip | ||
rm Externals.zip | ||
- name: Install missing packages | ||
run: brew install doxygen libomp | ||
- name: Install Qt | ||
working-directory: /Users/Shared | ||
run: | | ||
pip3 install aqtinstall --user | ||
mkdir Qt | ||
python3 -m aqt install --outputdir Qt 5.12.10 mac desktop -m qtcharts qtnetworkauth qtpurchasing qtdatavis3d qtscript qtvirtualkeyboard qtwebengine qtwebglplugin | ||
- name: Clone MITK | ||
run: git clone --branch v2022.10 https://phabricator.mitk.org/source/mitk.git /Users/Shared/MITK | ||
- name: Change timestamps of the MITK directory | ||
run: find /Users/Shared/MITK/ -exec touch -a -m -t 202104010000 {} \; | ||
- name: Clone CemrgApp | ||
uses: actions/checkout@v4 | ||
with: | ||
path: CemrgApp | ||
- name: Move CemrgApp | ||
run: mv CemrgApp /Users/Shared/ | ||
- name: Update the CemrgApp version | ||
working-directory: /Users/Shared/CemrgApp | ||
run: | | ||
sudo rm CemrgApp/Applications/MainApp/version.txt | ||
sudo echo ${{ needs.Variables.outputs.tag }} >> CemrgApp/Applications/MainApp/version.txt | ||
sudo echo ${{ needs.Variables.outputs.sha }} >> CemrgApp/Applications/MainApp/version.txt | ||
- name: Build | ||
working-directory: /Users/Shared/Build | ||
run: | | ||
cmake -DCMAKE_PREFIX_PATH=/Users/Shared/Qt/5.12.10/clang_64 -DMITK_EXTENSION_DIRS=/Users/Shared/CemrgApp/CemrgApp -DMITK_BUILD_ALL_PLUGINS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE="Release" ../MITK | ||
make -j6 | ||
- name: Package | ||
working-directory: /Users/Shared/Build/MITK-build | ||
continue-on-error: true | ||
run: make package -j6 | ||
- name: Create DMG | ||
working-directory: /Users/Shared/Build/MITK-build/_CPack_Packages/Darwin/DragNDrop/MITK-v2022.10-macos-x86_64 | ||
run: | | ||
rsync -au MitkWorkbench.app/Contents/Frameworks/ CemrgApp.app/Contents/Frameworks | ||
rsync -au MitkWorkbench.app/Contents/MacOS/ CemrgApp.app/Contents/MacOS | ||
cp -R /Users/Shared/Externals/ CemrgApp.app/Contents/MacOS | ||
rm CemrgApp.app/Contents/MacOS/MitkWorkbench* | ||
mkdir /Users/Shared/CemrgApp-macOS | ||
mv CemrgApp.app /Users/Shared/CemrgApp-macOS | ||
mv /Users/Shared/CemrgApp/README.md /Users/Shared/CemrgApp-macOS | ||
ln -s /Applications/ /Users/Shared/CemrgApp-macOS/Applications | ||
hdiutil create -volname CemrgApp -srcfolder /Users/Shared/CemrgApp-macOS -ov -format UDZO ${{ github.workspace }}/CemrgApp-macOS.dmg | ||
- name: Upload package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Packages-macOS | ||
path: CemrgApp-macOS.dmg |