diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cd90ebab..b65ade9f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,7 +5,7 @@ on: types: [published] jobs: - build: + npm: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -14,3 +14,33 @@ jobs: - run: npm publish --access public env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ !github.event.release.prerelease }} + - run: npm publish --access public --tag beta + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ github.event.release.prerelease }} + 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 + if: ${{ !github.event.release.prerelease }} + - run: snapcraft push --release=beta *.snap + if: ${{ github.event.release.prerelease }} diff --git a/VERSION b/VERSION deleted file mode 100644 index 9084fa2f..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.1.0 diff --git a/utils/svc_wrapper.sh b/snap/local/svc_wrapper.sh similarity index 93% rename from utils/svc_wrapper.sh rename to snap/local/svc_wrapper.sh index 51d74645..7b0be232 100755 --- a/utils/svc_wrapper.sh +++ b/snap/local/svc_wrapper.sh @@ -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 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index e21ef6e5..d1bb9dc8 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -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: utils/svc_wrapper.sh + command: ./svc_wrapper.sh daemon: forking plugs: [network, network-bind]