Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/auto-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
- name: Run desktop-snaps action
uses: ubuntu/desktop-snaps@stable
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3

- name: Update snapcraft.yaml
uses: ubuntu/desktop-snaps@12a322bc9b39889b93b71ffa2a1a1b2f0932cff5 # stable
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
yaml-path: snap/snapcraft.yaml

- name: Update legacy (og) snapcraft.yaml
uses: ubuntu/desktop-snaps@12a322bc9b39889b93b71ffa2a1a1b2f0932cff5 # stable
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
yaml-path: snap-og/snap/snapcraft.yaml
40 changes: 37 additions & 3 deletions .github/workflows/push-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,54 @@ on:
workflow_dispatch:

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
projects: ${{ steps.set.outputs.projects }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- if: github.event_name != 'workflow_dispatch'
uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3
id: filter
with:
filters: |
snap:
- 'snap/**'
snap-og:
- 'snap-og/**'

- id: set
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo 'projects=["snap","snap-og"]' >> "$GITHUB_OUTPUT"
else
echo 'projects=${{ steps.filter.outputs.changes }}' >> "$GITHUB_OUTPUT"
fi

build-and-publish:
needs: detect-changes
if: needs.detect-changes.outputs.projects != '[]'
strategy:
fail-fast: false
matrix:
project: ${{ fromJSON(needs.detect-changes.outputs.projects) }}
runner: [ubuntu-24.04, ubuntu-24.04-arm]

runs-on: "${{ matrix.runner }}"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- uses: snapcore/action-build@v1
- uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1
id: build
with:
path: ${{ matrix.project == 'snap' && '.' || matrix.project }}

- if: matrix.project == 'snap-og'
run: echo "Skipping publish for snap-og — og track not yet provisioned (built ${{ steps.build.outputs.snap }})"

- uses: snapcore/action-publish@v1
- if: matrix.project != 'snap-og'
uses: snapcore/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40 # v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/test-snap-can-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,40 @@ on:
branches: [ main ]

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
projects: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3
id: filter
with:
filters: |
snap:
- 'snap/**'
snap-og:
- 'snap-og/**'

build-and-check:
needs: detect-changes
if: needs.detect-changes.outputs.projects != '[]'
strategy:
fail-fast: false
matrix:
project: ${{ fromJSON(needs.detect-changes.outputs.projects) }}
runner: [ubuntu-24.04, ubuntu-24.04-arm]

runs-on: "${{ matrix.runner }}"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- uses: snapcore/action-build@v1
- uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1
id: build
with:
path: ${{ matrix.project == 'snap' && '.' || matrix.project }}

- uses: diddlesnaps/snapcraft-review-action@v1
- uses: diddlesnaps/snapcraft-review-action@40554b42331cf84dab19ef98c382620427f13482 # v1
with:
snap: ${{ steps.build.outputs.snap }}
isClassic: 'false'
Expand Down
20 changes: 20 additions & 0 deletions snap-og/snap/gui/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions snap-og/snap/gui/logseq.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Name=Logseq Desktop
Exec=logseq %U
Terminal=false
Type=Application
Icon=${SNAP}/snap/gui/icon.svg
Categories=Utility
79 changes: 79 additions & 0 deletions snap-og/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: logseq
base: core22
adopt-info: logseq
summary: Logseq is a privacy-first, open-source knowledge base.
description: |
Logseq is a privacy-first, open-source knowledge base that works on top of local plain-text Markdown and Org-mode files. Use it to write, organize and share your thoughts, keep your to-do list, and build your own digital garden.

grade: stable
confinement: strict

parts:
logseq:
plugin: nil
source: https://github.com/logseq/og.git
source-depth: 1
source-tag: '1.0.0'
build-packages:
- curl
- default-jdk
- libgif-dev
- zip
stage-packages:
- libnss3
- libnspr4

override-pull: |
craftctl default
craftctl set version=$(git describe --tags)

set -x

# Install node
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs

# Install clojure at required version
curl -fsSL https://download.clojure.org/install/linux-install-1.11.1.1413.sh | bash -

override-build: |
craftctl default

set -x

npm install --global yarn
yarn config set network-timeout 1000000
yarn install

yarn cljs:release && yarn release-electron &&\
mv ./static/out/Logseq-OG-linux-* $SNAPCRAFT_PART_INSTALL/app &&\
chmod 755 $SNAPCRAFT_PART_INSTALL/app

apps:
logseq:
command: app/Logseq-OG --no-sandbox
extensions:
- gnome
plugs:
- network
- shmem
- home
- etc-gitconfig
- gitconfig
- ssh-keys
- audio-playback
- removable-media

plugs:
shmem:
interface: shared-memory
private: true
etc-gitconfig:
interface: system-files
read:
- /etc/gitconfig
gitconfig:
interface: personal-files
read:
- $HOME/.gitconfig
- $HOME/.config/git/config
Loading