]> git.proxmox.com Git - mirror_novnc.git/blob - .github/workflows/deploy.yml
781309bcf219cd199657309b0f9e8d2d65ed8b46
[mirror_novnc.git] / .github / workflows / deploy.yml
1 name: Publish
2
3 on:
4 push:
5 pull_request:
6 release:
7 types: [published]
8
9 jobs:
10 npm:
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/checkout@v2
14 - uses: actions/setup-node@v1
15 with:
16 # Needs to be explicitly specified for auth to work
17 registry-url: 'https://registry.npmjs.org'
18 - run: npm install
19 - run: npm publish --access public
20 env:
21 NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
22 if: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
23 - run: npm publish --access public --tag beta
24 env:
25 NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
26 if: ${{ github.event_name == 'release' && github.event.release.prerelease }}
27 snap:
28 runs-on: ubuntu-latest
29 container: snapcore/snapcraft
30 steps:
31 - uses: actions/checkout@v2
32 - uses: actions/setup-node@v1
33 - run: npm install
34 - run: ./utils/use_require.js --clean --as commonjs --with-app
35 - run: |
36 cp utils/launch.sh build/launch.sh
37 cp snap/local/svc_wrapper.sh build/svc_wrapper.sh
38 - run: |
39 VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)
40 echo $VERSION
41 sed -i "s/@VERSION@/$VERSION/g" snap/snapcraft.yaml
42 - run: snapcraft
43 - run: |
44 mkdir .snapcraft
45 echo ${SNAPCRAFT_LOGIN} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
46 env:
47 SNAPCRAFT_LOGIN: ${{secrets.SNAPCRAFT_LOGIN}}
48 if: ${{ github.event_name == 'release' }}
49 - run: snapcraft push --release=stable *.snap
50 if: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
51 - run: snapcraft push --release=beta *.snap
52 if: ${{ github.event_name == 'release' && github.event.release.prerelease }}