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 - 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_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 - run: | VERSION=$(grep '"version"' package.json | cut -d '"' -f 4) echo $VERSION sed -i "s/@VERSION@/$VERSION/g" snap/snapcraft.yaml - run: snapcraft - uses: actions/upload-artifact@v2 with: name: snap path: novnc*.snap - 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 }}