Skip to content

Commit 2aaf170

Browse files
authored
Merge pull request #857 from MerginMaps/package-macos-arm64-builds
Ship arm64 pygeodiff builds with plugin
2 parents e68bc1e + 6eca29e commit 2aaf170

2 files changed

Lines changed: 40 additions & 20 deletions

File tree

.github/workflows/packages.yml

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Mergin Plugin Packages
1+
name: Build Package
22
on:
33
push:
44
workflow_dispatch:
@@ -10,19 +10,18 @@ on:
1010
type: string
1111
REQUESTED_GEODIFF_VER:
1212
description: 'Geodiff version'
13-
default: '2.0.4'
13+
default: '2.1.2'
1414
type: string
1515
env:
16-
PYTHON_API_CLIENT_VER: ${{ inputs.REQUESTED_PYTHON_API_CLIENT_VER || '0.12.0' }}
17-
GEODIFF_VER: ${{ inputs.REQUESTED_GEODIFF_VER || '2.0.4' }}
16+
PYTHON_API_CLIENT_VER: ${{ inputs.REQUESTED_PYTHON_API_CLIENT_VER || '0.12.1' }}
17+
GEODIFF_VER: ${{ inputs.REQUESTED_GEODIFF_VER || '2.1.2' }}
1818
PYTHON_VER: "38"
19-
PLUGIN_NAME: Mergin
2019
jobs:
2120
build_linux_binary:
2221
name: Extract geodiff binary linux
2322
runs-on: ubuntu-latest
2423
env:
25-
PY_PLATFORM: "manylinux2014_x86_64"
24+
PY_PLATFORM: "manylinux_2_28_x86_64"
2625
steps:
2726
- uses: actions/setup-python@v4
2827
name: Install Python
@@ -34,7 +33,7 @@ jobs:
3433
--no-deps --platform ${PY_PLATFORM} \
3534
--implementation cp \
3635
--abi cp${PYTHON_VER} pygeodiff==${GEODIFF_VER}
37-
unzip -o pygeodiff-$GEODIFF_VER-cp${PYTHON_VER}-cp${PYTHON_VER}-manylinux_2_17_x86_64.${PY_PLATFORM}.whl -d tmp || true
36+
unzip -o pygeodiff-$GEODIFF_VER-cp${PYTHON_VER}-cp${PYTHON_VER}-${PY_PLATFORM}.whl -d tmp || true
3837
mkdir pygeodiff-binaries
3938
cp tmp/pygeodiff/libpygeodiff-${GEODIFF_VER}-python.so ./pygeodiff-binaries/
4039
@@ -80,11 +79,9 @@ jobs:
8079
name: artifact-pygeodiff-windows
8180
path: ./pygeodiff-binaries/*.pyd
8281

83-
build_macos_binary:
82+
build_macos_binaries:
8483
name: Extract geodiff binary macos
8584
runs-on: macos-latest
86-
env:
87-
PY_PLATFORM: "macosx_10_9_x86_64"
8885
steps:
8986
- uses: actions/setup-python@v4
9087
name: Install Python
@@ -93,14 +90,16 @@ jobs:
9390
run: |
9491
brew install unzip
9592
96-
- name: Download pygeodiff binaries
93+
- name: Download pygeodiff binaries (Intel)
94+
env:
95+
PY_PLATFORM: "macosx_10_9_x86_64"
9796
run: |
9897
pip3 download --only-binary=:all: --no-deps --platform ${PY_PLATFORM} --python-version ${PYTHON_VER} --implementation cp --abi cp${PYTHON_VER} pygeodiff==$GEODIFF_VER
99-
unzip -o pygeodiff-$GEODIFF_VER-cp${PYTHON_VER}-cp${PYTHON_VER}-${PY_PLATFORM}.whl -d tmp
98+
unzip -o pygeodiff-$GEODIFF_VER-cp${PYTHON_VER}-cp${PYTHON_VER}-${PY_PLATFORM}.whl -d tmp32
10099
mkdir pygeodiff-binaries
101-
cp tmp/pygeodiff/*.dylib ./pygeodiff-binaries/
100+
cp tmp32/pygeodiff/*.dylib ./pygeodiff-binaries/
102101
103-
- name: Patching pygeodiff binaries
102+
- name: Patching pygeodiff binaries (Intel)
104103
run: |
105104
install_name_tool -change @loader_path/.dylibs/libsqlite3.0.dylib @rpath/libsqlite3.dylib ./pygeodiff-binaries/libpygeodiff-$GEODIFF_VER-python.dylib
106105
OTOOL_L=$(otool -L ./pygeodiff-binaries/libpygeodiff-$GEODIFF_VER-python.dylib)
@@ -110,13 +109,32 @@ jobs:
110109
exit 1
111110
fi
112111
112+
- name: Download pygeodiff binaries (arm64)
113+
env:
114+
PY_PLATFORM: "macosx_14_0_arm64"
115+
run: |
116+
pip3 download --only-binary=:all: --no-deps --platform ${PY_PLATFORM} --python-version ${PYTHON_VER} --implementation cp --abi cp${PYTHON_VER} pygeodiff==$GEODIFF_VER
117+
unzip -o pygeodiff-$GEODIFF_VER-cp${PYTHON_VER}-cp${PYTHON_VER}-${PY_PLATFORM}.whl -d tmp64
118+
cp tmp64/pygeodiff/libpygeodiff-$GEODIFF_VER-python-arm64.dylib ./pygeodiff-binaries/libpygeodiff-$GEODIFF_VER-python-arm64.dylib # expects that the folder is created before in the intel job
119+
120+
- name: Patching pygeodiff binaries (arm64)
121+
run: |
122+
install_name_tool -change @loader_path/.dylibs/libsqlite3.0.dylib @rpath/libsqlite3.dylib ./pygeodiff-binaries/libpygeodiff-$GEODIFF_VER-python-arm64.dylib
123+
codesign --force --sign - ./pygeodiff-binaries/libpygeodiff-$GEODIFF_VER-python-arm64.dylib
124+
OTOOL_L=$(otool -L ./pygeodiff-binaries/libpygeodiff-$GEODIFF_VER-python-arm64.dylib)
125+
if echo "${OTOOL_L}" | grep -q loader_path
126+
then
127+
echo "libpygeodiff-$GEODIFF_VER-python-arm64.dylib was not patched correctly, maybe sqlite version changed??"
128+
exit 1
129+
fi
130+
113131
- uses: actions/upload-artifact@v4
114132
with:
115133
name: artifact-pygeodiff-macos
116134
path: ./pygeodiff-binaries/*.dylib
117135

118-
create_mergin_plugin_package:
119-
needs: [build_windows_binaries, build_linux_binary, build_macos_binary]
136+
create_plugin_package:
137+
needs: [build_windows_binaries, build_linux_binary, build_macos_binaries]
120138
runs-on: ubuntu-latest
121139
steps:
122140
- uses: actions/checkout@v3
@@ -189,13 +207,13 @@ jobs:
189207
190208
- uses: actions/upload-artifact@v4
191209
with:
192-
name: Mergin b${{ env.BUILD_NUM }}
210+
name: MM Plugin d-${{ env.BUILD_NUM }}
193211
path: output/
194212

195213
- name: upload asset on tagged release
196214
uses: softprops/action-gh-release@v1
197215
if: startsWith(github.ref, 'refs/tags/')
198216
with:
199-
files: mergin.zip
217+
files: MM Plugin r-${{ env.BUILD_NUM }}.zip
200218
env:
201219
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Mergin/metadata.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ name=Mergin
44
qgisMinimumVersion=3.22
55
qgisMaximumVersion=4.99
66
description=Handle Mergin Maps projects
7-
version=2026.1.0
7+
version=2026.1.1
88
author=Lutra Consulting
99
email=info@merginmaps.com
1010
about=Mergin Maps is a repository for storing and tracking changes to QGIS projects/data and has its mobile app for field geo-surveys. With this plugin, users can upload and sync their data to Mergin Maps service.
1111
; end of mandatory metadata
1212

1313
; start of optional metadata
14-
changelog=2026.1.0
14+
changelog=2026.1.1
15+
- Fix support for macbooks with M chips (arm64)
16+
<p>2026.1.0
1517
- Integration of improved push mechanism
1618
- Added restart of sync process
1719
- Preventing trailing whitespace in project creation and photo name path

0 commit comments

Comments
 (0)