Files
noVNC/.github/workflows/deploy.yml
Pierre Ossman 76aa3d1256 Run NPM and snap builds on every push
To make sure these things still build. That means we need to make the
actual deploy parts optional.
2020-12-30 13:40:03 +01:00

53 lines
1.8 KiB
YAML

name: Publish
on:
push:
pull_request:
release:
types: [published]
jobs:
npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
# Needs to be explicitly specified for auth to work
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
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_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}}
if: ${{ github.event_name == 'release' }}
- run: snapcraft push --release=stable *.snap
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
- run: snapcraft push --release=beta *.snap
if: ${{ github.event_name == 'release' && github.event.release.prerelease }}