-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
149 additions
and
119 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,27 +8,31 @@ on: | |
|
||
# Allows you to run this workflow manually from the Actions tab. | ||
workflow_dispatch: | ||
inputs: | ||
debug_enabled: | ||
type: boolean | ||
description: 'Run the build with tmate debugging enabled' | ||
required: false | ||
default: false | ||
|
||
env: | ||
VNOTE_VER: 3.17.0 | ||
CMAKE_VER: 3.24.3 | ||
|
||
jobs: | ||
build: | ||
name: Build On MacOS | ||
runs-on: macos-latest | ||
timeout-minutes: 120 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
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: | ||
# Checks-out your repository under $GITHUB_WORKSPACE. | ||
|
@@ -44,7 +48,24 @@ jobs: | |
- name: Install Dependencies | ||
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 | ||
run: | | ||
|
@@ -56,17 +77,15 @@ jobs: | |
uses: actions/cache@v1 # not v2! | ||
with: | ||
path: ../Qt | ||
key: ${{ runner.os }}-QtCache-${{ matrix.config.qt }} | ||
key: ${{ runner.os }}-QtCache-6.5 | ||
|
||
- name: Install Qt | ||
uses: jurplel/install-qt-action@v3 | ||
with: | ||
version: ${{ matrix.config.qt }} | ||
version: 6.5.3 | ||
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 | ||
run: mkdir build | ||
|
@@ -75,77 +94,28 @@ jobs: | |
- name: Configure Project | ||
run: | | ||
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 | ||
|
||
- 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: | | ||
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 | ||
|
||
- 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 | ||
uses: actions/upload-artifact@v2 | ||
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 | ||
if: github.ref == 'refs/heads/master' | ||
|
@@ -158,7 +128,7 @@ jobs: | |
uses: johnwbyrd/[email protected] | ||
with: | ||
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 | ||
tag: continuous-build | ||
|
||
|
@@ -167,7 +137,7 @@ jobs: | |
uses: ncipollo/[email protected] | ||
with: | ||
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 | ||
tag: v${{env.VNOTE_VER}} | ||
allowUpdates: true | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ aqtinstall.log | |
tags | ||
CMakeLists.txt.user | ||
build | ||
.DS_Store |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR}/vnote.app -dmg | ||
-always-overwrite -verbose=1 | ||
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY} | ||
) |
Oops, something went wrong.