|
@@ -8,27 +8,31 @@ on:
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab.
|
|
# Allows you to run this workflow manually from the Actions tab.
|
|
workflow_dispatch:
|
|
workflow_dispatch:
|
|
|
|
+ inputs:
|
|
|
|
+ debug_enabled:
|
|
|
|
+ type: boolean
|
|
|
|
+ description: 'Run the build with tmate debugging enabled'
|
|
|
|
+ required: false
|
|
|
|
+ default: false
|
|
|
|
|
|
env:
|
|
env:
|
|
VNOTE_VER: 3.17.0
|
|
VNOTE_VER: 3.17.0
|
|
|
|
+ CMAKE_VER: 3.24.3
|
|
|
|
|
|
jobs:
|
|
jobs:
|
|
build:
|
|
build:
|
|
name: Build On MacOS
|
|
name: Build On MacOS
|
|
- runs-on: macos-latest
|
|
|
|
timeout-minutes: 120
|
|
timeout-minutes: 120
|
|
|
|
|
|
strategy:
|
|
strategy:
|
|
|
|
+ fail-fast: false
|
|
matrix:
|
|
matrix:
|
|
config:
|
|
config:
|
|
- # - {
|
|
|
|
- # name: "Build Qt 5.12",
|
|
|
|
- # qt: 5.12.12
|
|
|
|
- # }
|
|
|
|
- - {
|
|
|
|
- name: "Build Qt 5.15",
|
|
|
|
- qt: 5.15.2
|
|
|
|
- }
|
|
|
|
|
|
+ - name: "Build on Arm64"
|
|
|
|
+ os: macos-latest
|
|
|
|
+ arch: universal
|
|
|
|
+
|
|
|
|
+ runs-on: ${{matrix.config.os}}
|
|
|
|
|
|
steps:
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE.
|
|
# Checks-out your repository under $GITHUB_WORKSPACE.
|
|
@@ -44,7 +48,24 @@ jobs:
|
|
|
|
|
|
- name: Install Dependencies
|
|
- name: Install Dependencies
|
|
run: |
|
|
run: |
|
|
- brew install tree
|
|
|
|
|
|
+ brew install tree libiodbc libpq
|
|
|
|
+
|
|
|
|
+ - name: Fix SQL
|
|
|
|
+ if: ${{matrix.config.arch == 'universal'}}
|
|
|
|
+ run: |
|
|
|
|
+ sudo mkdir -p /usr/local/opt/libiodbc/lib
|
|
|
|
+ sudo ln -s /opt/homebrew/opt/libiodbc/lib/libiodbc.2.dylib /usr/local/opt/libiodbc/lib/libiodbc.2.dylib
|
|
|
|
+ sudo mkdir -p /Applications/Postgres.app/Contents/Versions/14/lib
|
|
|
|
+ sudo ln -s /opt/homebrew/Cellar/libpq/16.3/lib/libpq.5.dylib /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib
|
|
|
|
+
|
|
|
|
+ - name: Install a fresh CMake
|
|
|
|
+ run: |
|
|
|
|
+ wget --no-verbose https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-macos-universal.tar.gz
|
|
|
|
+ tar xzf cmake-${CMAKE_VER}-macos-universal.tar.gz
|
|
|
|
+ sudo rm -f /usr/local/bin/cmake /usr/local/bin/cpack
|
|
|
|
+ sudo ln -s ${{runner.workspace}}/cmake-${CMAKE_VER}-macos-universal/CMake.app/Contents/bin/cmake /usr/local/bin/cmake
|
|
|
|
+ sudo ln -s ${{runner.workspace}}/cmake-${CMAKE_VER}-macos-universal/CMake.app/Contents/bin/cpack /usr/local/bin/cpack
|
|
|
|
+ working-directory: ${{runner.workspace}}
|
|
|
|
|
|
- name: Install macdeployqtfix
|
|
- name: Install macdeployqtfix
|
|
run: |
|
|
run: |
|
|
@@ -56,17 +77,15 @@ jobs:
|
|
uses: actions/cache@v1 # not v2!
|
|
uses: actions/cache@v1 # not v2!
|
|
with:
|
|
with:
|
|
path: ../Qt
|
|
path: ../Qt
|
|
- key: ${{ runner.os }}-QtCache-${{ matrix.config.qt }}
|
|
|
|
|
|
+ key: ${{ runner.os }}-QtCache-6.5
|
|
|
|
|
|
- name: Install Qt
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v3
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
with:
|
|
- version: ${{ matrix.config.qt }}
|
|
|
|
|
|
+ version: 6.5.3
|
|
target: desktop
|
|
target: desktop
|
|
- modules: qtwebengine
|
|
|
|
- cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
|
|
|
- setup-python: 'false'
|
|
|
|
-
|
|
|
|
|
|
+ modules: 'qtwebengine qtwebchannel qtpositioning qtpdf qtimageformats qt5compat qtserialport'
|
|
|
|
+ cache: 'true'
|
|
|
|
|
|
- name: Create Build Dir
|
|
- name: Create Build Dir
|
|
run: mkdir build
|
|
run: mkdir build
|
|
@@ -75,77 +94,28 @@ jobs:
|
|
- name: Configure Project
|
|
- name: Configure Project
|
|
run: |
|
|
run: |
|
|
qmake -v
|
|
qmake -v
|
|
- qmake CONFIG+=release ${GITHUB_WORKSPACE}/vnote.pro
|
|
|
|
|
|
+ cmake --version
|
|
|
|
+ cmake -DMACDEPLOYQTFIX_EXECUTABLE=${{runner.workspace}}/macdeployqtfix/macdeployqtfix.py -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ${GITHUB_WORKSPACE}
|
|
working-directory: ${{runner.workspace}}/build
|
|
working-directory: ${{runner.workspace}}/build
|
|
|
|
|
|
- name: Build Project
|
|
- name: Build Project
|
|
- run: make -j4
|
|
|
|
- working-directory: ${{runner.workspace}}/build
|
|
|
|
-
|
|
|
|
- - name: Deploy VSyntaxHighlighting Framework
|
|
|
|
- run: |
|
|
|
|
- my_lib_name=VSyntaxHighlighting
|
|
|
|
- my_lib_framework=${my_lib_name}.framework
|
|
|
|
- my_lib_dir=./libs/vtextedit/src/libs/syntax-highlighting
|
|
|
|
- frameworks_dir=./src/vnote.app/Contents/Frameworks
|
|
|
|
- mkdir -p ${frameworks_dir}
|
|
|
|
- cp -R ${my_lib_dir}/${my_lib_framework} ${frameworks_dir}
|
|
|
|
- working-directory: ${{runner.workspace}}/build
|
|
|
|
-
|
|
|
|
- - name: Deploy VTextEdit Framework
|
|
|
|
run: |
|
|
run: |
|
|
- my_lib_name=VTextEdit
|
|
|
|
- my_lib_framework=${my_lib_name}.framework
|
|
|
|
- my_lib_dir=./libs/vtextedit/src/editor
|
|
|
|
- frameworks_dir=./src/vnote.app/Contents/Frameworks
|
|
|
|
- mkdir -p ${frameworks_dir}
|
|
|
|
- cp -R ${my_lib_dir}/${my_lib_framework} ${frameworks_dir}
|
|
|
|
|
|
+ cmake --build . --target pack
|
|
|
|
+ ls -ls .
|
|
|
|
+ ls -ls src
|
|
|
|
+ mv src/vnote.dmg VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
|
|
working-directory: ${{runner.workspace}}/build
|
|
working-directory: ${{runner.workspace}}/build
|
|
|
|
|
|
- - name: Cleanup rpath
|
|
|
|
- run: |
|
|
|
|
- app_target=./src/vnote.app/Contents/MacOS/vnote
|
|
|
|
- install_name_tool -delete_rpath ${PWD}/src/../libs/vtextedit/src/editor ${app_target}
|
|
|
|
- install_name_tool -delete_rpath ${PWD}/src/../libs/vtextedit/src/libs/syntax-highlighting ${app_target}
|
|
|
|
- working-directory: ${{runner.workspace}}/build
|
|
|
|
-
|
|
|
|
- - name: Mac Deploy
|
|
|
|
- run: |
|
|
|
|
- pushd src
|
|
|
|
- macdeployqt vnote.app
|
|
|
|
-
|
|
|
|
- # Remove unused sql drivers
|
|
|
|
- rm vnote.app/Contents/Plugins/sqldrivers/libqsqlodbc.dylib
|
|
|
|
- rm vnote.app/Contents/Plugins/sqldrivers/libqsqlpsql.dylib
|
|
|
|
-
|
|
|
|
- python ${{runner.workspace}}/macdeployqtfix/macdeployqtfix.py vnote.app/Contents/MacOS/vnote $Qt5_Dir
|
|
|
|
- # Fix Helpers/QtWebEngineProcess.app
|
|
|
|
- pushd vnote.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/5/Helpers
|
|
|
|
- python ${{runner.workspace}}/macdeployqtfix/macdeployqtfix.py QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess $Qt5_Dir
|
|
|
|
- popd
|
|
|
|
-
|
|
|
|
- popd
|
|
|
|
- tree ./
|
|
|
|
- working-directory: ${{runner.workspace}}/build
|
|
|
|
-
|
|
|
|
- - name: Package Project
|
|
|
|
- run: |
|
|
|
|
- mkdir -p distrib/vnote
|
|
|
|
- pushd distrib/vnote
|
|
|
|
- mv ../../src/vnote.app ./
|
|
|
|
- ln -s /Applications ./Applications
|
|
|
|
- popd
|
|
|
|
- sleep 60
|
|
|
|
- hdiutil create -srcfolder ./distrib/vnote -format UDBZ vnote-mac-x64_v${{env.VNOTE_VER}}.dmg
|
|
|
|
- cp vnote-mac-x64_v${{env.VNOTE_VER}}.dmg vnote-mac-x64-qt${{matrix.config.qt}}.dmg
|
|
|
|
- mv vnote-mac-x64_v${{env.VNOTE_VER}}.dmg vnote-mac-x64-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.dmg
|
|
|
|
- working-directory: ${{runner.workspace}}/build
|
|
|
|
|
|
+ # Enable tmate debugging of manually-triggered workflows if the input option was provided
|
|
|
|
+ - name: Setup tmate session
|
|
|
|
+ uses: mxschmitt/action-tmate@v3
|
|
|
|
+ if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
|
|
|
|
|
|
- name: Archive Artifacts
|
|
- name: Archive Artifacts
|
|
uses: actions/upload-artifact@v2
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
with:
|
|
- name: vnote-mac-x64-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}
|
|
|
|
- path: ${{runner.workspace}}/build/vnote-mac-x64-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.dmg
|
|
|
|
|
|
+ name: VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}
|
|
|
|
+ path: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
|
|
|
|
|
|
- name: Update Tag
|
|
- name: Update Tag
|
|
if: github.ref == 'refs/heads/master'
|
|
if: github.ref == 'refs/heads/master'
|
|
@@ -158,7 +128,7 @@ jobs:
|
|
uses: johnwbyrd/[email protected]
|
|
uses: johnwbyrd/[email protected]
|
|
with:
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
- files: ${{runner.workspace}}/build/vnote-mac-x64-qt${{matrix.config.qt}}.dmg
|
|
|
|
|
|
+ files: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
|
|
release: Continuous Build
|
|
release: Continuous Build
|
|
tag: continuous-build
|
|
tag: continuous-build
|
|
|
|
|
|
@@ -167,7 +137,7 @@ jobs:
|
|
uses: ncipollo/[email protected]
|
|
uses: ncipollo/[email protected]
|
|
with:
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
- artifacts: ${{runner.workspace}}/build/vnote-mac-x64-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.dmg
|
|
|
|
|
|
+ artifacts: ${{runner.workspace}}/build/VNote-${{env.VNOTE_VER}}-mac-${{matrix.config.arch}}.dmg
|
|
commit: master
|
|
commit: master
|
|
tag: v${{env.VNOTE_VER}}
|
|
tag: v${{env.VNOTE_VER}}
|
|
allowUpdates: true
|
|
allowUpdates: true
|