mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-21 19:35:49 +08:00
move deploy process to a shell script
This commit is contained in:
@@ -3,7 +3,7 @@ name: Build macOS
|
||||
on:
|
||||
workflow_dispatch:
|
||||
env:
|
||||
QT_VERSION: "6.8.0"
|
||||
QT_VERSION: "6.7.2"
|
||||
GO_VERSION: "1.23.0"
|
||||
LIBPLIST_VER: "2.7.0"
|
||||
LIBTATSU_VER: "1.0.5"
|
||||
@@ -139,87 +139,8 @@ jobs:
|
||||
- name: Build with CMake
|
||||
run: cmake --build build --config Release
|
||||
|
||||
- name: Deploy Qt dependencies
|
||||
run: |
|
||||
macdeployqt build/iDescriptor.app -qmldir=qml -verbose=2
|
||||
|
||||
# Bundle GStreamer
|
||||
GST_PLUGIN_DIR="build/iDescriptor.app/Contents/Frameworks/gstreamer"
|
||||
mkdir -p "${GST_PLUGIN_DIR}"
|
||||
|
||||
PLUGINS=(
|
||||
"libgstapp"
|
||||
"libgstaudioconvert"
|
||||
"libgstautodetect"
|
||||
"libgstavi"
|
||||
"libgstcoreelements"
|
||||
"libgstlevel"
|
||||
"libgstlibav"
|
||||
"libgstosxaudio"
|
||||
"libgstplayback"
|
||||
"libgstvolume"
|
||||
)
|
||||
|
||||
for plugin in "${PLUGINS[@]}"; do
|
||||
cp "$(brew --prefix gstreamer)/lib/gstreamer-1.0/${plugin}.dylib" "${GST_PLUGIN_DIR}/"
|
||||
done
|
||||
|
||||
cp "$(brew --prefix gstreamer)/libexec/gstreamer-1.0/gst-plugin-scanner" "build/iDescriptor.app/Contents/Frameworks/"
|
||||
|
||||
# Bundle libjxl_cms
|
||||
cp "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/
|
||||
install_name_tool -id "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl_cms.0.11.dylib
|
||||
install_name_tool -change "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl.0.11.dylib
|
||||
|
||||
# Add rpath to main executable
|
||||
install_name_tool -add_rpath "@executable_path/../Frameworks" build/iDescriptor.app/Contents/MacOS/iDescriptor
|
||||
|
||||
# Fix GStreamer library paths
|
||||
FRAMEWORKS_DIR="build/iDescriptor.app/Contents/Frameworks"
|
||||
BREW_PREFIX="$(brew --prefix)"
|
||||
|
||||
# For some reason libavfilter sometimes doesnt get copied by macdeployqt
|
||||
FFMPEG_LIB_DIR="$(brew --prefix ffmpeg)/lib"
|
||||
cp ${FFMPEG_LIB_DIR}/libavfilter.11.dylib "${FRAMEWORKS_DIR}/"
|
||||
|
||||
# Fix dependencies in all GStreamer plugins
|
||||
for plugin in "${GST_PLUGIN_DIR}"/*.dylib; do
|
||||
echo "Fixing plugin: $(basename ${plugin})"
|
||||
|
||||
# Get all dependencies and fix them
|
||||
otool -L "${plugin}" | grep -E "${BREW_PREFIX}" | awk '{print $1}' | while read dep; do
|
||||
depname=$(basename "${dep}")
|
||||
echo " Changing ${depname}"
|
||||
install_name_tool -change "${dep}" "@rpath/${depname}" "${plugin}" 2>/dev/null || true
|
||||
done
|
||||
done
|
||||
|
||||
# Fix dependencies in GStreamer core libraries themselves
|
||||
for lib in "${FRAMEWORKS_DIR}"/libgst*.dylib "${FRAMEWORKS_DIR}"/libglib*.dylib "${FRAMEWORKS_DIR}"/libgobject*.dylib "${FRAMEWORKS_DIR}"/libgmodule*.dylib "${FRAMEWORKS_DIR}"/libgio*.dylib "${FRAMEWORKS_DIR}"/libgthread*.dylib; do
|
||||
if [ -f "${lib}" ]; then
|
||||
echo "Fixing library: $(basename ${lib})"
|
||||
|
||||
otool -L "${lib}" | grep -E "${BREW_PREFIX}" | awk '{print $1}' | while read dep; do
|
||||
depname=$(basename "${dep}")
|
||||
echo " Changing ${depname}"
|
||||
install_name_tool -change "${dep}" "@rpath/${depname}" "${lib}" 2>/dev/null || true
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Create DMG
|
||||
run: |
|
||||
create-dmg \
|
||||
--volname "iDescriptor" \
|
||||
--volicon "resources/icons/app-icon/icon.icns" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 600 400 \
|
||||
--icon-size 100 \
|
||||
--icon "iDescriptor.app" 175 190 \
|
||||
--hide-extension "iDescriptor.app" \
|
||||
--app-drop-link 425 190 \
|
||||
"build/iDescriptor-macOS-${{ matrix.arch }}.dmg" \
|
||||
"build/iDescriptor.app"
|
||||
- name: Deploy and create DMG
|
||||
run: ./deploy-dmg.sh ${{ matrix.arch }}
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
Reference in New Issue
Block a user