Skip to content

Commit b248d30

Browse files
committed
add version input to build workflows and update deployment scripts
1 parent 537b081 commit b248d30

6 files changed

Lines changed: 114 additions & 95 deletions

File tree

.github/workflows/build-linux.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ name: Build Linux
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Build version (e.g., v1.2.3)"
8+
required: true
9+
default: "dev"
10+
workflow_call:
11+
inputs:
12+
version:
13+
description: "Build version (e.g., v1.2.3)"
14+
required: true
15+
type: string
16+
default: "dev"
517
env:
618
QT_VERSION: "6.7.2"
719
GO_VERSION: "1.23.0"
@@ -150,10 +162,10 @@ jobs:
150162

151163
- name: Build AppImage
152164
run: |
153-
export VERSION=1.0.0
165+
export VERSION=${{ inputs.version }}
154166
# linuxdeployqt tries to bundle SQL drivers which we don't need
155167
rm -rf ${{ github.workspace }}/Qt/{${{ env.QT_VERSION }}/gcc_64/plugins/sqldrivers/**
156-
./scripts/deploy-appimage.sh $VERSION
168+
./scripts/deploy-appimage.sh ${{ inputs.version }}
157169
158170
- name: Upload Artifact (Linux)
159171
if: runner.os == 'Linux'

.github/workflows/build-macos.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ name: Build macOS
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Build version (e.g., v1.2.3)"
8+
required: true
9+
default: "dev"
10+
workflow_call:
11+
inputs:
12+
version:
13+
description: "Build version (e.g., v1.2.3)"
14+
required: true
15+
type: string
16+
default: "dev"
517
env:
618
QT_VERSION: "6.7.2"
719
GO_VERSION: "1.23.0"
@@ -19,8 +31,8 @@ jobs:
1931
include:
2032
- runner: macos-15-intel
2133
arch: x86_64
22-
# - runner: macos-14
23-
# arch: arm64
34+
- runner: macos-14
35+
arch: arm64
2436
runs-on: ${{ matrix.runner }}
2537

2638
steps:
@@ -140,7 +152,7 @@ jobs:
140152
run: cmake --build build --config Release
141153

142154
- name: Deploy and create DMG
143-
run: ./deploy-dmg.sh ${{ matrix.arch }}
155+
run: ./scripts/deploy-dmg.sh ${{ matrix.arch }} ${{ inputs.version }}
144156

145157
- name: Upload Artifact
146158
uses: actions/upload-artifact@v4

.github/workflows/build-windows.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ name: Build Windows
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Build version (e.g., v1.2.3)"
8+
required: true
9+
default: "dev"
10+
workflow_call:
11+
inputs:
12+
version:
13+
description: "Build version (e.g., v1.2.3)"
14+
required: true
15+
type: string
16+
default: "dev"
517
env:
618
QT_VERSION: "6.8.0"
719
GO_VERSION: "1.23.0"

.github/workflows/build.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
1-
name: Build iDescriptor
1+
name: Build & Release iDescriptor
22

33
on:
4-
# push:
5-
# branches: ["main"]
6-
# pull_request:
7-
# branches: ["main"]
4+
push:
5+
tags:
6+
- "v*"
87
workflow_dispatch:
98

109
jobs:
1110
build-linux:
1211
uses: ./.github/workflows/build-linux.yml
12+
with:
13+
version: ${{ github.ref_name }}
1314
secrets: inherit
1415

1516
build-windows:
1617
uses: ./.github/workflows/build-windows.yml
18+
with:
19+
version: ${{ github.ref_name }}
1720
secrets: inherit
1821

1922
build-macos:
2023
uses: ./.github/workflows/build-macos.yml
24+
with:
25+
version: ${{ github.ref_name }}
2126
secrets: inherit
27+
28+
release:
29+
needs: [build-linux, build-windows, build-macos]
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Prepare output folder
34+
run: mkdir target
35+
36+
- name: Download all artifacts
37+
uses: actions/download-artifact@v6
38+
with:
39+
path: target
40+
41+
- name: Create GitHub Release
42+
uses: softprops/action-gh-release@v2
43+
with:
44+
files: target/*
45+
tag: ${{ github.ref }}
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/deploy-dmg.sh

Lines changed: 39 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,31 @@
33
set -euo pipefail
44

55
ARCH="${1:-x86_64}"
6+
VERSION="${2:-dev}"
67
BUILD_DIR="build"
78
APP_PATH="${BUILD_DIR}/iDescriptor.app"
89

9-
echo "Starting deployment for architecture: ${ARCH}"
1010

11-
# Deploy Qt dependencies
12-
echo "Deploying Qt dependencies..."
13-
macdeployqt "${APP_PATH}" -qmldir=qml -verbose=2
11+
echo "Deploying iDescriptor DMG for ${ARCH} architecture (version: ${VERSION})"
12+
13+
# Determine the platform-specific suffix for the DMG name based on architecture
14+
PLATFORM_SUFFIX=""
15+
if [ "${ARCH}" == "x86_64" ]; then
16+
PLATFORM_SUFFIX="Apple_Intel"
17+
elif [ "${ARCH}" == "arm64" ]; then
18+
PLATFORM_SUFFIX="Apple_Silicon"
19+
else
20+
echo "Error: Unsupported architecture '${ARCH}'."
21+
exit 1
22+
fi
23+
24+
# Ensure the app exists
25+
if [ ! -d "${APP_PATH}" ]; then
26+
echo "Error: ${APP_PATH} not found."
27+
exit 1
28+
fi
29+
1430

15-
# Bundle GStreamer
16-
echo "Bundling GStreamer..."
1731
GST_PLUGIN_DIR="${APP_PATH}/Contents/Frameworks/gstreamer"
1832
mkdir -p "${GST_PLUGIN_DIR}"
1933

@@ -30,28 +44,26 @@ PLUGINS=(
3044
"libgstvolume"
3145
)
3246

47+
BREW_PREFIX="$(brew --prefix)"
48+
49+
# Copy GStreamer plugins
3350
for plugin in "${PLUGINS[@]}"; do
34-
cp "$(brew --prefix gstreamer)/lib/gstreamer-1.0/${plugin}.dylib" "${GST_PLUGIN_DIR}/"
51+
cp "${BREW_PREFIX}/lib/gstreamer-1.0/${plugin}.dylib" "${GST_PLUGIN_DIR}/"
3552
done
3653

54+
# Copy gst-plugin-scanner
3755
cp "$(brew --prefix gstreamer)/libexec/gstreamer-1.0/gst-plugin-scanner" "${APP_PATH}/Contents/Frameworks/"
3856

3957
# Bundle libjxl_cms
40-
echo "Bundling libjxl_cms..."
41-
cp "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" "${APP_PATH}/Contents/Frameworks/"
58+
# For some reason libjxl_cms is not bundled by macdeployqt, so we do it manually
59+
cp "${BREW_PREFIX}/lib/libjxl_cms.0.11.dylib" "${APP_PATH}/Contents/Frameworks/"
4260
install_name_tool -id "@rpath/libjxl_cms.0.11.dylib" "${APP_PATH}/Contents/Frameworks/libjxl_cms.0.11.dylib"
43-
install_name_tool -change "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" "@rpath/libjxl_cms.0.11.dylib" "${APP_PATH}/Contents/Frameworks/libjxl.0.11.dylib"
4461

45-
# Add rpath to main executable
46-
echo "Adding rpath to main executable..."
62+
# Add RPATH to main executable
4763
install_name_tool -add_rpath "@executable_path/../Frameworks" "${APP_PATH}/Contents/MacOS/iDescriptor"
4864

49-
# Fix GStreamer library paths
50-
echo "Fixing GStreamer library paths..."
51-
FRAMEWORKS_DIR="${APP_PATH}/Contents/Frameworks"
52-
BREW_PREFIX="$(brew --prefix)"
5365

54-
# Copy GStreamer core libraries
66+
# Copy GStreamer + GLib core libraries
5567
GST_LIBS=(
5668
"libgstreamer-1.0.0.dylib"
5769
"libgstbase-1.0.0.dylib"
@@ -62,86 +74,33 @@ GST_LIBS=(
6274
"libgsttag-1.0.0.dylib"
6375
"libgstriff-1.0.0.dylib"
6476
"libgstcodecparsers-1.0.0.dylib"
77+
"libgstrtp-1.0.0.dylib"
78+
"libgstsdp-1.0.0.dylib"
6579
"libglib-2.0.0.dylib"
6680
"libgobject-2.0.0.dylib"
6781
"libgmodule-2.0.0.dylib"
6882
"libgio-2.0.0.dylib"
6983
"libgthread-2.0.0.dylib"
7084
)
7185

86+
FRAMEWORKS_DIR="${APP_PATH}/Contents/Frameworks"
87+
7288
for lib in "${GST_LIBS[@]}"; do
7389
if [ -f "${BREW_PREFIX}/lib/${lib}" ]; then
7490
cp "${BREW_PREFIX}/lib/${lib}" "${FRAMEWORKS_DIR}/"
7591
install_name_tool -id "@rpath/${lib}" "${FRAMEWORKS_DIR}/${lib}"
76-
echo "Copied and fixed ID for ${lib}"
92+
echo "Copied and fixed ID for ${lib}"
7793
fi
7894
done
7995

80-
# For some reason libavfilter sometimes doesnt get copied by macdeployqt
96+
# Copy FFmpeg libavfilter
8197
FFMPEG_LIB_DIR="$(brew --prefix ffmpeg)/lib"
8298
cp "${FFMPEG_LIB_DIR}"/libavfilter.*.dylib "${FRAMEWORKS_DIR}/"
8399

84-
# Copy additional audio-related libraries that are missing
85-
echo "Bundling additional audio libraries..."
86-
ADDITIONAL_LIBS=(
87-
"libarchive.13.dylib"
88-
"libass.9.dylib"
89-
"libb2.1.dylib"
90-
"libfribidi.0.dylib"
91-
"libgif.dylib"
92-
"libgraphite2.3.dylib"
93-
"libharfbuzz.0.dylib"
94-
"libjpeg.8.dylib"
95-
"liblcms2.2.dylib"
96-
"libleptonica.6.dylib"
97-
"liblz4.1.dylib"
98-
"librubberband.3.dylib"
99-
"libsamplerate.0.dylib"
100-
"libtesseract.5.dylib"
101-
"libtiff.6.dylib"
102-
"libunibreak.6.dylib"
103-
"libvidstab.1.2.dylib"
104-
"libzimg.2.dylib"
105-
)
106-
107-
for lib in "${ADDITIONAL_LIBS[@]}"; do
108-
if [ -f "${BREW_PREFIX}/lib/${lib}" ]; then
109-
cp "${BREW_PREFIX}/lib/${lib}" "${FRAMEWORKS_DIR}/"
110-
install_name_tool -id "@rpath/${lib}" "${FRAMEWORKS_DIR}/${lib}"
111-
else
112-
echo "Warning: ${lib} not found, skipping..."
113-
fi
114-
done
115-
116-
# Fix dependencies in all GStreamer plugins
117-
echo "Fixing GStreamer plugin dependencies..."
118-
for plugin in "${GST_PLUGIN_DIR}"/*.dylib; do
119-
echo "Fixing plugin: $(basename "${plugin}")"
120-
121-
# Get all dependencies and fix them
122-
otool -L "${plugin}" | grep -E "${BREW_PREFIX}" | awk '{print $1}' | while read dep; do
123-
depname=$(basename "${dep}")
124-
echo " Changing ${depname}"
125-
install_name_tool -change "${dep}" "@rpath/${depname}" "${plugin}" 2>/dev/null || true
126-
done
127-
done
100+
macdeployqt "${APP_PATH}" -qmldir=qml -verbose=2
128101

129-
# Fix dependencies in GStreamer core libraries themselves
130-
echo "Fixing GStreamer core library dependencies..."
131-
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
132-
if [ -f "${lib}" ]; then
133-
echo "Fixing library: $(basename "${lib}")"
134-
135-
otool -L "${lib}" | grep -E "${BREW_PREFIX}" | awk '{print $1}' | while read dep; do
136-
depname=$(basename "${dep}")
137-
echo " Changing ${depname}"
138-
install_name_tool -change "${dep}" "@rpath/${depname}" "${lib}" 2>/dev/null || true
139-
done
140-
fi
141-
done
102+
DMG_NAME="iDescriptor-${VERSION}-${PLATFORM_SUFFIX}.dmg"
142103

143-
# Create DMG
144-
echo "Creating DMG..."
145104
create-dmg \
146105
--volname "iDescriptor" \
147106
--volicon "resources/icons/app-icon/icon.icns" \
@@ -151,7 +110,5 @@ create-dmg \
151110
--icon "iDescriptor.app" 175 190 \
152111
--hide-extension "iDescriptor.app" \
153112
--app-drop-link 425 190 \
154-
"${BUILD_DIR}/iDescriptor-macOS-${ARCH}.dmg" \
155-
"${APP_PATH}"
156-
157-
echo "Deployment complete for architecture: ${ARCH}"
113+
"${BUILD_DIR}/${DMG_NAME}" \
114+
"${APP_PATH}"

src/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ int main(int argc, char *argv[])
6262
QString gstPluginScannerPath =
6363
QDir::toNativeSeparators(frameworksPath + "/gst-plugin-scanner");
6464

65-
qputenv("GST_PLUGIN_PATH", gstPluginPath.toUtf8());
66-
qputenv("GST_PLUGIN_SYSTEM_PATH", gstPluginPath.toUtf8());
67-
qputenv("GST_PLUGIN_SCANNER_1_0", gstPluginScannerPath.toUtf8());
65+
setenv("GST_PLUGIN_PATH", gstPluginPath.toUtf8().constData(), 1);
66+
setenv("GST_PLUGIN_SYSTEM_PATH", gstPluginPath.toUtf8().constData(), 1);
67+
setenv("GST_PLUGIN_SCANNER", gstPluginScannerPath.toUtf8().constData(), 1);
6868
#endif
6969
QCoreApplication::setOrganizationName("iDescriptor");
7070
QCoreApplication::setApplicationName("iDescriptor");

0 commit comments

Comments
 (0)