diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 454ff8bd..6b0ac968 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,8 @@ name: Publish on: + push: + pull_request: release: types: [published] @@ -14,36 +16,41 @@ jobs: # Needs to be explicitly specified for auth to work registry-url: 'https://registry.npmjs.org' - run: npm install + - uses: actions/upload-artifact@v2 + with: + name: npm + path: lib - run: npm publish --access public env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - if: ${{ !github.event.release.prerelease }} + if: ${{ github.event_name == 'release' && !github.event.release.prerelease }} - run: npm publish --access public --tag beta env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - if: ${{ github.event.release.prerelease }} + if: ${{ github.event_name == 'release' && 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 }} + - uses: snapcore/action-build@v1 + id: snapcraft + - uses: actions/upload-artifact@v2 + with: + name: snap + path: ${{ steps.snapcraft.outputs.snap }} + - uses: snapcore/action-publish@v1 + with: + store_login: ${{ secrets.SNAPCRAFT_LOGIN }} + snap: ${{ steps.build.outputs.snap }} + release: stable + if: ${{ github.event_name == 'release' && !github.event.release.prerelease }} + - uses: snapcore/action-publish@v1 + with: + store_login: ${{ secrets.SNAPCRAFT_LOGIN }} + snap: ${{ steps.build.outputs.snap }} + release: beta + if: ${{ github.event_name == 'release' && github.event.release.prerelease }} diff --git a/docs/EMBEDDING.md b/docs/EMBEDDING.md index 6a5dcd80..10500141 100644 --- a/docs/EMBEDDING.md +++ b/docs/EMBEDDING.md @@ -71,24 +71,6 @@ query string. Currently the following options are available: * `logging` - The console log level. Can be one of `error`, `warn`, `info` or `debug`. -## Pre-conversion of Modules - -noVNC is written using ECMAScript 6 modules. Many of the major browsers support -these modules natively, but not all. By default the noVNC application includes -a script that can convert these modules to an older format as they are being -loaded. However this process can be slow and severely increases the load time -for the application. - -It is possible to perform this conversion ahead of time, avoiding the extra -load times. To do this please follow these steps: - - 1. Install Node.js - 2. Run `npm install` in the noVNC directory - 3. Run `./utils/use_require.js --with-app --as commonjs` - -This will produce a `build/` directory that includes everything needed to run -the noVNC application. - ## HTTP Serving Considerations ### Browser Cache Issue diff --git a/docs/LIBRARY.md b/docs/LIBRARY.md index 63f55e8f..3890bb20 100644 --- a/docs/LIBRARY.md +++ b/docs/LIBRARY.md @@ -18,18 +18,14 @@ do things. ## Conversion of Modules -noVNC is written using ECMAScript 6 modules. Many of the major browsers support -these modules natively, but not all. They are also not supported by Node.js. To -use noVNC in these places the library must first be converted. +noVNC is written using ECMAScript 6 modules. This is not supported by older +versions of Node.js. To use noVNC with those older versions of Node.js the +library must first be converted. Fortunately noVNC includes a script to handle this conversion. Please follow the following steps: 1. Install Node.js 2. Run `npm install` in the noVNC directory - 3. Run `./utils/use_require.js --as ` - -Several module formats are available. Please run -`./utils/use_require.js --help` to see them all. The result of the conversion is available in the `lib/` directory. diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 94886d47..b5b26a03 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -13,8 +13,24 @@ confinement: strict parts: novnc: - source: build/ + source: . plugin: dump + organize: + utils/launch.sh: / + stage: + - vnc.html + - app + - core/**/*.js + - vendor/**/*.js + - launch.sh + stage-packages: + - bash + + svc-script: + source: snap/local + plugin: dump + stage: + - svc_wrapper.sh stage-packages: - bash - jq