Skip to content

Commit

Permalink
Bundle galacteek-starter in flatpak and dmg too
Browse files Browse the repository at this point in the history
[appimage]
[deploy]
  • Loading branch information
cipres authored and cipres committed May 22, 2022
1 parent e802f50 commit f0ea79a
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 262 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/galacteek-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
# compilation
ls /usr/local/Cellar/openssl@1.1
echo "PKG_CONFIG_PATH=/usr/local/Cellar/openssl@1.1/1.1.1n/lib/pkgconfig:/usr/local/Cellar/openssl/1.1.1n/lib/pkgconfig" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/Cellar/openssl@1.1/1.1.1o/lib/pkgconfig:/usr/local/Cellar/openssl/1.1.1o/lib/pkgconfig" >> $GITHUB_ENV
- name: OS-specific vars (win)
if: startsWith(matrix.os, 'windows')
Expand Down
20 changes: 15 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ prepare:
echo "export ARTIFACT_WHEEL=dist/${CI_PROJECT_NAME}-${GALACTEEK_VERSION}-py3-none-any.whl" >> $GALACTEEK_ENV_FILE
echo "export WHEEL_ASSET_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${GALACTEEK_VERSION}/${WHEEL_FILENAME}" >> $GALACTEEK_ENV_FILE
# dist list (yaml)
echo "export DISTMAP_ASSET_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${GALACTEEK_VERSION}/dist-install.yaml" >> $GALACTEEK_ENV_FILE
# wheel dist (yaml)
echo "export DISTMAP_ASSET_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${GALACTEEK_VERSION}/dist-wheel.yaml" >> $GALACTEEK_ENV_FILE
- export

Expand Down Expand Up @@ -142,23 +142,29 @@ build:
- source $GALACTEEK_ENV_FILE
- mkdir -p $ASSETS_ROOT

# Install CI tools
- pip install "git+https://gitlab.com/galacteek/ci-tools"

- pip install -U pip
- pip install -r requirements.txt

- python setup.py build build_docs
- python setup.py sdist bdist_wheel

- export WHEEL_SHA512_CHECKSUM=$(sha512sum "dist/${WHEEL_FILENAME}"|awk '{print $1}')

# Upload wheel
- >
curl --progress-bar
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file dist/${WHEEL_FILENAME} ${WHEEL_ASSET_URL}
- python .gitlab/write-dist.py --template .gitlab/dist.tmpl.yaml --dst dist-install.yaml
- yaml-xform -s .gitlab/wheel.tmpl.yaml -o dist-wheel.yaml

- >
curl --progress-bar
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file dist-install.yaml ${DISTMAP_ASSET_URL}
--upload-file dist-wheel.yaml ${DISTMAP_ASSET_URL}
- |-
if [[ $CI_COMMIT_MESSAGE =~ '[appimage]' ]]; then
Expand All @@ -179,6 +185,10 @@ build:
if [[ $CI_COMMIT_MESSAGE =~ '[flatpak]' ]] || [[ $CI_COMMIT_MESSAGE =~ '[flatpak-repo]' ]] || [[ $CI_COMMIT_MESSAGE =~ '[flatpak-bundle]' ]]; then
echo "Building flatpak as ${FLATPAK_FILENAME}"
yaml-xform -s \
packaging/linux/flatpak/io.gitlab.galacteek.Galacteek_oc.yaml \
-o packaging/linux/flatpak/io.gitlab.galacteek.Galacteek.yaml
# Build to flatpak repo
flatpak-builder --force-clean --install-deps-from=flathub \
--keep-build-dirs \
Expand Down Expand Up @@ -331,7 +341,7 @@ release:
--assets-link \
"{\"name\" :\"${WHEEL_FILENAME}\", \"filepath\": \"/galacteek-latest-py3-none-any.whl\", \"url\": \"${WHEEL_ASSET_URL}\"}" \
--assets-link \
"{\"name\" :\"dist-install.yaml\", \"filepath\": \"/dist-install.yaml\", \"url\": \"${DISTMAP_ASSET_URL}\"}" \
"{\"name\" :\"dist-wheel.yaml\", \"filepath\": \"/dist-wheel.yaml\", \"url\": \"${DISTMAP_ASSET_URL}\"}" \
--assets-link \
"{\"name\" :\"${APPIMAGE_FILENAME}\", \"filepath\": \"/${APPIMAGE_FILEPATH}\", \"url\": \"${APPIMAGE_ASSET_URL}\"}" \
--assets-link \
Expand Down
8 changes: 6 additions & 2 deletions .gitlab/dist.tmpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
branch: ${oc.env:CI_COMMIT_BRANCH}
wheels:
- name: galacteek
dist:
- pkgname: galacteek
disturl: ${oc.env:WHEEL_ASSET_URL}
version: ${oc.env:GALACTEEK_VERSION}
sha512_checksum_hex: ${oc.env:WHEEL_SHA512_CHECKSUM}
git_commit_sha: ${oc.env:CI_COMMIT_SHA}
pip_install_flags:
- --no-deps

- ${yaml_get:https://gitlab.com/galacteek/galacteek-ld-web4/-/releases/continuous-master/downloads/dist-wheel.yaml}
7 changes: 7 additions & 0 deletions .gitlab/wheel.tmpl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pkgname: galacteek
disturl: ${oc.env:WHEEL_ASSET_URL}
version: ${oc.env:GALACTEEK_VERSION}
sha512_checksum_hex: ${oc.env:WHEEL_SHA512_CHECKSUM}
git_commit_sha: ${oc.env:CI_COMMIT_SHA}
pip_install_flags:
- --no-deps
File renamed without changes.
1 change: 1 addition & 0 deletions AppImage/AppRun
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export FONTCONFIG_PATH=$HERE/usr/etc/fonts/

export PATH=${HERE}/usr/bin:$PATH
export LD_LIBRARY_PATH=${HERE}/usr/lib:$LD_LIBRARY_PATH
export PYTHONHOME=${HERE}/usr
export PYTHONPATH=$PYTHONPATH:${HERE}/usr/lib/python3.7/site-packages
export QT_QPA_PLATFORM_PLUGIN_PATH=${HERE}/usr/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms
export QT_STYLE_OVERRIDE=Fusion
Expand Down
211 changes: 0 additions & 211 deletions AppImage/appimage-build

This file was deleted.

3 changes: 3 additions & 0 deletions AppImage/appimage-build-gitlab
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ $APPIPIP install $WHEEL'[rdf-bsddb]'
# starter
$APPIPIP install "git+https://gitlab.com/galacteek/galacteek-starter"

$APPIPIP uninstall -y galacteek
$APPIPIP uninstall -y galacteek-ld-web4

cp ../{COPYING,LICENSE,LICENSE.go-ipfs,LICENSE.Qt.GPLv3} \
$APPDIR/usr/share/licenses/galacteek
cp ../galacteek.desktop $APPDIR/usr/share/applications
Expand Down
28 changes: 25 additions & 3 deletions ci/build-dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,17 @@ WHEEL="$OLD_CWD"/dist/galacteek-${G_VERSION}-py3-none-any.whl
# install dependencies
pip install wheel
pip install -r "$OLD_CWD"/requirements.txt
pip install $WHEEL
# pip install $WHEEL
pip install $WHEEL'[markdown-extensions]'

# ui-pyqt (5.15)
pip install $WHEEL'[ui-pyqt-5.15]'

# starter
pip install "git+https://gitlab.com/galacteek/galacteek-starter"
pip uninstall -y galacteek
pip uninstall -y galacteek-ld-web4

# leave conda env
source deactivate

Expand Down Expand Up @@ -121,15 +126,32 @@ cp /usr/local/Cellar/openssl@1.1/1.1.1*/lib/libcrypto*.dylib galacteek.app/Conte
cat > galacteek.app/Contents/MacOS/galacteek <<\EAT
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export SSL_CERT_FILE="${DIR}/../Resources/lib/python3.7/site-packages/certifi/cacert.pem"
export PYTHONPATH="${DIR}/../Resources/lib/python3.7/site-packages"
export SSL_CERT_FILE="${PYTHONPATH}/certifi/cacert.pem"
export GALACTEEK_MAGIC_DBPATH="${DIR}/../Resources/share/file/magic-galacteek.mgc"
export DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH:$DIR/../Resources/lib"
export PATH=$PATH:$DIR/../Resources/bin
"$DIR/../Resources/bin/python" "$DIR/../Resources/bin/galacteek-starter" --from-dmg
EAT

# create entry script for galacteek
cat > galacteek.app/Contents/MacOS/galacteek-debug <<\EAT
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PYTHONPATH="${DIR}/../Resources/lib/python3.7/site-packages"
export SSL_CERT_FILE="${PYTHONPATH}/certifi/cacert.pem"
export GALACTEEK_MAGIC_DBPATH="${DIR}/../Resources/share/file/magic-galacteek.mgc"
export DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH:$DIR/../Resources/lib"
export PATH=$PATH:$DIR/../Resources/bin
"$DIR/../Resources/bin/python" $DIR/../Resources/bin/galacteek --from-dmg
"$DIR/../Resources/bin/python" "$DIR/../Resources/bin/galacteek-starter" --from-dmg -d
EAT

chmod a+x galacteek.app/Contents/MacOS/galacteek
chmod a+x galacteek.app/Contents/MacOS/galacteek-debug

# bloat deletion sequence
pushd galacteek.app/Contents/Resources
Expand Down
11 changes: 6 additions & 5 deletions galacteek/core/ctx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,11 +1015,12 @@ async def oldP2PInit(self, ipfsop):
except Exception:
log.debug('Could not register DID Auth service')

try:
self.dagExchService = dagexchange.DAGExchangeService()
await self.register(self.dagExchService)
except Exception:
log.debug('Could not register DAG service')
if 0:
try:
self.dagExchService = dagexchange.DAGExchangeService()
await self.register(self.dagExchService)
except Exception:
log.debug('Could not register DAG service')

async def stop(self):
for srv in self.services:
Expand Down
Loading

0 comments on commit f0ea79a

Please sign in to comment.