Skip to content

Commit

Permalink
Snap GitHub actions (#5811)
Browse files Browse the repository at this point in the history
* Use github action to build snap
Update snap with chrome path for native-messaging

* Separate build and upload

* Add upload on non master

* Modify both chromium and firefox native-messaging files

* Add name to snap build stage
  • Loading branch information
LyzardKing authored and tobiasdiez committed Jan 8, 2020
1 parent db13dc0 commit 7c1ef61
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,21 @@ jobs:
- name: Package application image
run: ${{ matrix.archivePortable }}
shell: bash
- name: Build and publish snap
- name: Build snap (1) Setup snapcraft
uses: jhenstridge/snapcraft-build-action@v1
id: snapcraft
if: matrix.displayName == 'linux'
- name: Build snap (2) Run build
run: |
mv ${{ steps.snapcraft.outputs.snap }} build/distribution/
if: matrix.displayName == 'linux'
- name: Build snap (3) Upload snap
if: matrix.displayName == 'linux' && github.ref == 'refs/heads/master'
env:
SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
run: |
mkdir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv jabref*.snap build/distribution/ && snapcraft push build/distribution/jabref*.snap --release edge || true"
snapcraft push build/distribution/jabref*.snap --release edge || true"
shell: bash
- name: Rename files
run: |
Expand Down
20 changes: 13 additions & 7 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ plugs:
opengl:
network-bind:
removable-media:
browser-extension:
interface: system-files
read:
- /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts
write:
plugs:
hostfs-mozilla-native-messaging-jabref:
interface: system-files
write:
- /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json

hostfs-chrome-native-messaging-jabref:
interface: system-files
write:
- /var/lib/snapd/hostfs/etc/opt/chrome/native-messaging-hosts/org.jabref.jabref.json
hostfs-chromium-native-messaging-jabref:
interface: system-files
write:
- /var/lib/snapd/hostfs/etc/chromium/native-messaging-hosts/org.jabref.jabref.json
parts:
jabref:
plugin: dump
Expand All @@ -49,4 +55,4 @@ parts:
override-build: |
snapcraftctl build
snapcraftctl set-version "$(cat $SNAPCRAFT_PART_INSTALL/lib/app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)"
sed -i 's|/opt/jabref/lib/jabrefHost.py|/snap/bin/jabref.browser-proxy|g' $SNAPCRAFT_PART_INSTALL/lib/org.jabref.jabref.json
sed -i 's|/opt/jabref/lib/jabrefHost.py|/snap/bin/jabref.browser-proxy|g' $SNAPCRAFT_PART_INSTALL/lib/native-messaging-host/*/org.jabref.jabref.json

0 comments on commit 7c1ef61

Please sign in to comment.