diff --git a/.github/workflows/build.yml b/.github/workflows/build_story_editor_linux.yml similarity index 97% rename from .github/workflows/build.yml rename to .github/workflows/build_story_editor_linux.yml index ff8abe2..9a52d93 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build_story_editor_linux.yml @@ -1,10 +1,10 @@ -name: BuildAndPackage +name: BuildStoryEditor-Linux on: workflow_dispatch: {} - push: - branches: - - main + schedule: + - cron: "0 0 * * *" + env: QT_VERSION: 6.5.1 diff --git a/.github/workflows/build_story_editor_windows.yml b/.github/workflows/build_story_editor_windows.yml new file mode 100644 index 0000000..7ed60cd --- /dev/null +++ b/.github/workflows/build_story_editor_windows.yml @@ -0,0 +1,68 @@ +name: BuildStoryEditor-Windows + +on: + workflow_dispatch: {} + push: + branches: + - main +env: + QT_VERSION: 6.5.1 + +jobs: + build_win: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - uses: ilammy/msvc-dev-cmd@v1 + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: install_deps + run : | + choco install wget -y + choco install nsis -y + choco install ninja -y + choco install cmake -y + pip install aqtinstall + - name: install_qt + run : | + python3 -m aqt install-qt -m qtmultimedia -O ${{ github.workspace }}/Qt/ windows desktop ${{ env.QT_VERSION }} win64_msvc2019_64 + echo "${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: build + working-directory: ./story-editor + run : | + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ github.workspace }}\Qt\${{ env.QT_VERSION }}\msvc2019_64 -DQT_DIR=${{ github.workspace }}\Qt\6.5.1\msvc2019_64\lib\cmake\Qt6 -G Ninja .. + ninja + ls + mkdir story-editor + cp story-editor.exe story-editor + windeployqt story-editor/story-editor.exe --release + copy C:\Windows\System32\vccorlib140.dll story-editor\ + copy C:\Windows\System32\msvcp140.dll story-editor\ + copy C:\Windows\System32\vcruntime140.dll story-editor\ + ${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/bin/windeployqt.exe story-editor\story-editor.exe + - name: package_setup + working-directory: ./story-editor + run : | + makensis.exe /V3 nsis-installer.nsi + - name: upload_zip_artefact + uses: actions/upload-artifact@v3 + with: + name: StoryEditorWindows-Zip + path: ./story-editor/build/story-editor + - name: upload_stup_artefact + uses: actions/upload-artifact@v3 + with: + name: StoryEditorWindows-Setup + path: ./story-editor/build/story-editor-setup.exe + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + ./story-editor/build/story-editor-setup.exe + ./story-editor/build/StoryEditor-Windows.zip diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml deleted file mode 100644 index 8e608a9..0000000 --- a/.github/workflows/build_windows.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: BuildStoryEditor-Windows - -on: - workflow_dispatch: {} - push: - branches: [ master ] -env: - QT_VERSION: 6.5.1 - -jobs: - build_win: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: ilammy/msvc-dev-cmd@v1 - - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - name: install_deps - run : | - choco install wget -y - choco install nsis -y - choco install ninja -y - choco install cmake -y - pip install aqtinstall - - name: install_qt - run : | - python3 -m aqt install-qt -m qtmultimedia -O ${{ github.workspace }}/Qt/ windows desktop ${{ env.QT_VERSION }} win64_msvc2019_64 - echo "${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: build - working-directory: ./story-editor - run : | - mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ github.workspace }}\Qt\6.5.1\msvc2019_64 -DQT_DIR=${{ github.workspace }}\Qt\6.5.1\msvc2019_64\lib\cmake\Qt6 -G Ninja .. - ninja - ls diff --git a/story-editor/CMakeLists.txt b/story-editor/CMakeLists.txt index d9a6a53..44b970e 100644 --- a/story-editor/CMakeLists.txt +++ b/story-editor/CMakeLists.txt @@ -151,7 +151,9 @@ set(NODEEDITOR_HEADER_FILES ./nodeeditor/include/QtNodes/internal/UndoCommands.hpp ) - +if (WIN32) + list(APPEND PROJECT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/icon.rc") +endif() qt_add_executable(${PROJECT_NAME} MANUAL_FINALIZATION @@ -174,6 +176,9 @@ target_link_libraries(${PROJECT_NAME} PUBLIC QHexView ) + + + if (UNIX) target_link_libraries(${PROJECT_NAME} PUBLIC dl) endif (UNIX) diff --git a/story-editor/icon.rc b/story-editor/icon.rc new file mode 100644 index 0000000..28fac41 --- /dev/null +++ b/story-editor/icon.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "story-editor-logo.ico" diff --git a/story-editor/nsis-installer.nsi b/story-editor/nsis-installer.nsi new file mode 100644 index 0000000..7330313 --- /dev/null +++ b/story-editor/nsis-installer.nsi @@ -0,0 +1,53 @@ +# define installer name +!define APPNAME "StoryEditor" +!define COMPANYNAME "OpenStoryTeller" +!define DESCRIPTION "A story editor using graphical nodes, for the OpenStoryTeller project. http://openstoryteller.org" + +!define VERSIONMAJOR 1 +!define VERSIONMINOR 3 +!define VERSIONBUILD 4 +OutFile "build/story-editor-setup.exe" + +# set desktop as install directory +InstallDir "$PROGRAMFILES64\${APPNAME}" +Name "${COMPANYNAME} - ${APPNAME}" + +# default section start +Section + +# define output path +SetOutPath $INSTDIR + +# specify file to go in output path +File /r "build/story-editor\*" +File "story-editor-logo.ico" + +# define uninstaller name +WriteUninstaller $INSTDIR\uninstaller.exe + +# Create shortcut +SetShellVarContext all +CreateDirectory "$SMPROGRAMS\${COMPANYNAME}" +CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\story-editor.exe" "" "$INSTDIR\story-editor-logo.ico" +SetShellVarContext current + + +#------- +# default section end +SectionEnd + +# create a section to define what the uninstaller does. +# the section will always be named "Uninstall" +Section "Uninstall" + +# Always delete uninstaller first +Delete $INSTDIR\uninstaller.exe +Delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" +Delete $INSTDIR\story-editor-logo.ico + +# now delete installed file +Delete $INSTDIR\* + +# Delete the directory +RMDir /r $INSTDIR +SectionEnd diff --git a/story-editor/story-editor-logo.ico b/story-editor/story-editor-logo.ico new file mode 100644 index 0000000..667cf60 Binary files /dev/null and b/story-editor/story-editor-logo.ico differ