This commit is contained in:
Pierre Ossman 2020-12-30 16:13:52 +01:00
commit 4a319c414d
4 changed files with 46 additions and 45 deletions

View File

@ -1,6 +1,8 @@
name: Publish name: Publish
on: on:
push:
pull_request:
release: release:
types: [published] types: [published]
@ -14,36 +16,41 @@ jobs:
# Needs to be explicitly specified for auth to work # Needs to be explicitly specified for auth to work
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
- run: npm install - run: npm install
- uses: actions/upload-artifact@v2
with:
name: npm
path: lib
- run: npm publish --access public - run: npm publish --access public
env: env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 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 - run: npm publish --access public --tag beta
env: env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ github.event.release.prerelease }} if: ${{ github.event_name == 'release' && github.event.release.prerelease }}
snap: snap:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: snapcore/snapcraft
steps: steps:
- uses: actions/checkout@v2 - 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: | - run: |
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4) VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)
echo $VERSION echo $VERSION
sed -i "s/@VERSION@/$VERSION/g" snap/snapcraft.yaml sed -i "s/@VERSION@/$VERSION/g" snap/snapcraft.yaml
- run: snapcraft - uses: snapcore/action-build@v1
- run: | id: snapcraft
mkdir .snapcraft - uses: actions/upload-artifact@v2
echo ${SNAPCRAFT_LOGIN} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg with:
env: name: snap
SNAPCRAFT_LOGIN: ${{secrets.SNAPCRAFT_LOGIN}} path: ${{ steps.snapcraft.outputs.snap }}
- run: snapcraft push --release=stable *.snap - uses: snapcore/action-publish@v1
if: ${{ !github.event.release.prerelease }} with:
- run: snapcraft push --release=beta *.snap store_login: ${{ secrets.SNAPCRAFT_LOGIN }}
if: ${{ github.event.release.prerelease }} 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 }}

View File

@ -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 * `logging` - The console log level. Can be one of `error`, `warn`, `info` or
`debug`. `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 ## HTTP Serving Considerations
### Browser Cache Issue ### Browser Cache Issue

View File

@ -18,18 +18,14 @@ do things.
## Conversion of Modules ## Conversion of Modules
noVNC is written using ECMAScript 6 modules. Many of the major browsers support noVNC is written using ECMAScript 6 modules. This is not supported by older
these modules natively, but not all. They are also not supported by Node.js. To versions of Node.js. To use noVNC with those older versions of Node.js the
use noVNC in these places the library must first be converted. library must first be converted.
Fortunately noVNC includes a script to handle this conversion. Please follow Fortunately noVNC includes a script to handle this conversion. Please follow
the following steps: the following steps:
1. Install Node.js 1. Install Node.js
2. Run `npm install` in the noVNC directory 2. Run `npm install` in the noVNC directory
3. Run `./utils/use_require.js --as <module format>`
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. The result of the conversion is available in the `lib/` directory.

View File

@ -13,8 +13,24 @@ confinement: strict
parts: parts:
novnc: novnc:
source: build/ source: .
plugin: dump 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: stage-packages:
- bash - bash
- jq - jq