]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Deploy new snap on release
authorPierre Ossman <ossman@cendio.se>
Fri, 26 Jun 2020 12:12:37 +0000 (14:12 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 26 Jun 2020 12:48:32 +0000 (14:48 +0200)
.github/workflows/deploy.yml
snap/local/svc_wrapper.sh
snap/snapcraft.yaml

index cd90ebab576286214e74b3466f799d8747b07295..75a566bdf76179c9fe34f2b8febfb7fe538dcf23 100644 (file)
@@ -5,7 +5,7 @@ on:
     types: [published]
 
 jobs:
-  build:
+  npm:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
@@ -14,3 +14,25 @@ jobs:
       - run: npm publish --access public
         env:
           NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
+  snap:
+    runs-on: ubuntu-latest
+    container: snapcore/snapcraft
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v1
+      - run: npm install
+      - run: ./utils/use_require.js --clean --as commonjs --with-app
+      - run: |
+          cp utils/launch.sh build/launch.sh
+          cp snap/local/svc_wrapper.sh build/svc_wrapper.sh
+      - run: |
+          VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)
+          echo $VERSION
+          sed -i "s/@VERSION@/$VERSION/g" snap/snapcraft.yaml
+      - run: snapcraft
+      - run: |
+          mkdir .snapcraft
+          echo ${SNAPCRAFT_LOGIN} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
+        env:
+          SNAPCRAFT_LOGIN: ${{secrets.SNAPCRAFT_LOGIN}}
+      - run: snapcraft push --release=stable *.snap
index 51d746452aaeb9743176a6732436c31114478224..7b0be232af1afc438a59ce34696d5fc33436c6e7 100755 (executable)
@@ -24,6 +24,6 @@ snapctl get services | jq -c '.[]' | while read service; do # for each service t
         echo "novnc: not starting service ${service} with listen_port ${listen_port} and vnc_host_port ${vnc_host_port}"
     else
         # start (and fork with '&') the service using the specified listen port and VNC host:port
-        $SNAP/utils/launch.sh --listen $listen_port --vnc $vnc_host_port &
+        $SNAP/launch.sh --listen $listen_port --vnc $vnc_host_port &
     fi
 done
index 2549c057e38ac68324338e07303dc22d32d1df08..d1bb9dc8a6c47823e9135c45dc23b15467d0cb7c 100644 (file)
@@ -1,17 +1,19 @@
 name: novnc
 base: core18 # the base snap is the execution environment for this snap
-version: '1.1.0'
+version: '@VERSION@'
 summary: Open Source VNC client using HTML5 (WebSockets, Canvas)
 description: |
   Open Source VNC client using HTML5 (WebSockets, Canvas).
-  noVNC is both a VNC client JavaScript library as well as an application built on top of that library. noVNC runs well in any modern browser including mobile browsers (iOS and Android).
+  noVNC is both a VNC client JavaScript library as well as an
+  application built on top of that library. noVNC runs well in any
+  modern browser including mobile browsers (iOS and Android).
 
 grade: stable
 confinement: strict
 
 parts:
     novnc:
-        source: https://github.com/novnc/noVNC.git #https://github.com/novnc/noVNC/archive/v$SNAPCRAFT_PROJECT_VERSION.tar.gz 
+        source: build/
         plugin: dump
         stage-packages:
             - websockify
@@ -26,9 +28,9 @@ hooks:
 
 apps:
     novnc:
-        command: utils/launch.sh
+        command: ./launch.sh
         plugs: [network, network-bind]
     novncsvc:
-        command: snap/local/svc_wrapper.sh
+        command: ./svc_wrapper.sh
         daemon: forking
         plugs: [network, network-bind]