Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
* master:
  ARTE features for ProMesh (#2)
  • Loading branch information
anaegel committed Dec 17, 2024
2 parents 3760d33 + 9d74e14 commit 2af797d
Show file tree
Hide file tree
Showing 11 changed files with 292 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,21 @@ jobs:


steps:
- name: (1) Checkout
uses: actions/checkout@v3

- name: (1.1) Install Qt
uses: jurplel/install-qt-action@v3
with:
tools: 'tools_qtcreator,qt.tools.qtcreator'

- name: (1.2) Check content
if: startsWith(matrix.os, 'windows') == true
run: |
dir ..\Qt\5.15.2\msvc2019_64
dir ..\Qt\5.15.2\msvc2019_64\bin
dir ..\Qt\5.15.2\msvc2019_64\lib
- name: (2.0) Checkout self.
uses: actions/checkout@v4

- name: (2.1) Install UG4 - ugcore
uses: actions/checkout@v4
Expand Down Expand Up @@ -90,8 +103,6 @@ jobs:
cmake -B ug4-git/build -S ug4-git/ugcore -DTARGET=libgrid -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DProMesh=ON -DLuaShell=ON -DPARALLEL=OFF -Dtetgen=ON -DDIM=3
cmake --build ug4-git/build --config ${{ matrix.build_type }}
#- name: (2b) Build UG4/tool_tetgen.git
# run: |
# cmake -B ug4-git/tools/tetgen/build -S ug4-git/tools/tetgen
Expand All @@ -110,10 +121,6 @@ jobs:
# mkdir ug4-git\bin
# copy ug4-git\tools\tetgen\build\Release\tetgen.exe ug4-git\bin\tetgen.exe


- name: (4) Install Qt
uses: jurplel/install-qt-action@v3


- name: (5) Install GL develop
if: startsWith(matrix.os, 'ubuntu') == true
Expand Down Expand Up @@ -141,15 +148,19 @@ jobs:



- name: (8) Build

- name: (8.1) Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}


- name: (8.2) Fix content
run: |
..\Qt\5.15.2\msvc2019_64\bin\windeployqt.exe ${{ github.workspace }}\build\Release
- name: (9) Artifacts
uses: actions/upload-artifact@v4
with:
name: my-artifacts
name: artifacts-${{ matrix.os }}
path: ${{ github.workspace }}/build # or path/to/artifact

- name: (10) Test
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/02-build-installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build installer

on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:

installer-build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

# Set up a matrix to run the following 3 configurations:
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
# os: [ubuntu-latest, windows-latest]
os: [windows-latest]
build_type: [Release]

steps:
- name: (0) Checkout self.
uses: actions/checkout@v4

- name: (1) Artifacts
uses: actions/download-artifact@v4
with:
name: artifacts-${{matrix.os}}
path: artifacts
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: 12359566993

- name: (2) Move dir.
if: startsWith( ${{ matrix.os }}, "windows-latest")
run: Move-Item -Path artifacts/Release -Destination deployment/win64/artifacts

- name: (3) Create installer
if: startsWith( ${{ matrix.os }}, "windows-latest")
uses: joncloud/[email protected]
with:
script-file: "deployment/win64/promesh4-installer.nsi"
arguments: "/V3"

- name: (4) Artifacts
if: startsWith( ${{ matrix.os }}, "windows-latest")
uses: actions/upload-artifact@v4
with:
name: ProMesh4-Installer-${{ matrix.os }}
path: ${{ github.workspace }}/deployment/win64/ProMesh4-Installer.exe # or path/to/artifact

83 changes: 83 additions & 0 deletions .github/workflows/03-update-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
#tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Upload Release Asset
jobs:
build:
name: Upload Release Asset for ${{ matrix.os }}

runs-on: ubuntu-latest


strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [windows-latest]
build_type: [Release]

steps:
- name: Checkout self
uses: actions/checkout@v4

- name: Download pre-packed asset
uses: actions/download-artifact@v4
with:
# name: ProMesh4-Installer-${{matrix.os}}
name: ProMesh4-Installer-windows-latest
# path: $GITHUB_WORKSPACE
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: 12355131211

- name: Download pre-packed artifact
run: ls .

#- name: Download pre-packed artifact
# run: ls ./assets

# Fetch the latest release from GitHub API
- name: Get latest release
id: get_release
run: |
latest_release=$(curl -s \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases/latest)
echo "::set-output name=upload_url::$(echo $latest_release | jq -r .upload_url | sed -e "s/{?name,label}//")"
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# draft: false
# prerelease: false

- name: Test
run: echo "URL=${{ steps.get_release.outputs.upload_url }}"

#- name: Upload Release Binary
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# #upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./ProMesh4-Installer.exe
# asset_name: promesh_setup_win64.exe
# asset_content_type: application/octet-stream

- name: Upload Release Binary
uses: AButler/[email protected]
with:
files: "./ProMesh4-Installer.exe"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: v0.0.2
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ else(UNIX)
if(MINGW)
# resource compilation for MINGW
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ProMeshIcon.o
COMMAND windres.exe -I${CMAKE_SOURCE_DIR}/deploy_data -i${CMAKE_SOURCE_DIR}/deploy_data/ProMeshIcon.rc
COMMAND windres.exe -I${CMAKE_SOURCE_DIR}/deployment/data -i${CMAKE_SOURCE_DIR}/deployment/data/ProMeshIcon.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/ProMeshIcon.o )
ADD_EXECUTABLE(ProMesh4 WIN32 ${allSources} ProMeshIcon.o)
else(MINGW)
ADD_EXECUTABLE(ProMesh4 WIN32 ${allSources} ${CMAKE_SOURCE_DIR}/deploy_data/ProMeshIcon.rc)
ADD_EXECUTABLE(ProMesh4 WIN32 ${allSources} ${CMAKE_SOURCE_DIR}/deployment/data/ProMeshIcon.rc)
endif(MINGW)
endif(UNIX)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
125 changes: 125 additions & 0 deletions deployment/win64/promesh4-installer.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
;--------------------------------

; The name of the installer
Name ProMesh4

; The file to write
OutFile "ProMesh4-Installer.exe"

; The default installation directory
InstallDir $PROGRAMFILES64\ProMesh4

; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "SOFTWARE\G-CSC\ProMesh4" "Install_Dir"

; Request application privileges for Windows Vista
RequestExecutionLevel admin

Icon "..\data\ProMeshIcon.ico"

LicenseBkColor /windows
LicenseData "..\..\LICENSE"

XPStyle on
ManifestSupportedOS all

;--------------------------------

; Pages

Page license
Page directory
Page components
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles

;--------------------------------

; The stuff to install
Section ProMesh4 (required)"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "artifacts\ProMesh4.exe"
File "artifacts\\*.dll"
SetOutPath $INSTDIR\platforms
File "artifacts\platforms\*.dll"
SetOutPath $INSTDIR\tools
File "artifacts\tools\*.exe"
; File "artifacts\tools\*LICENSE"
SetOutPath $INSTDIR\translations
File "artifacts\translations\*"
SetOutPath $INSTDIR\imageformats
File "artifacts\imageformats\*"
SetOutPath $INSTDIR\iconengines
File "artifacts\iconengines\*"
SetOutPath $INSTDIR
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\G-CSC\ProMesh4 "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\G-CSC\ProMesh4" "DisplayName" "ProMesh4"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\G-CSC\ProMesh4" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\G-CSC\ProMesh4" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\G-CSC\ProMesh4" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Programs Shortcut"
CreateDirectory "$SMPROGRAMS\ProMesh4"
CreateShortcut "$SMPROGRAMS\ProMesh4\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortcut "$SMPROGRAMS\ProMesh4\ProMesh4.lnk" "$INSTDIR\ProMesh4.exe" "" "$INSTDIR\ProMesh4.exe" 0
SectionEnd
Section "Start Menu Shortcut"
CreateShortcut "$STARTMENU\ProMesh4.lnk" "$INSTDIR\ProMesh4.exe" "" "$INSTDIR\ProMesh4.exe" 0
SectionEnd
Section "Desktop Shortcut"
CreateShortcut "$DESKTOP\ProMesh4.lnk" "$INSTDIR\ProMesh4.exe" "" "$INSTDIR\ProMesh4.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\G-CSC\ProMesh4"
DeleteRegKey HKLM SOFTWARE\G-CSC\ProMesh4
; Remove files and uninstaller
Delete $INSTDIR\ProMesh4.exe
Delete $INSTDIR\*.dll
RMDir /r /REBOOTOK $INSTDIR\platforms
Delete $INSTDIR\uninstall.exe
; Remove shortcuts, if any
Delete "$SMPROGRAMS\ProMesh4\*.*"
Delete "$STARTMENU\ProMesh4.lnk"
Delete "$DESKTOP\ProMesh4.lnk"
; Remove directories used
RMDir "$SMPROGRAMS\ProMesh4"
RMDir "$INSTDIR"
SectionEnd

0 comments on commit 2af797d

Please sign in to comment.