mirror of
https://github.com/novnc/noVNC.git
synced 2026-05-26 15:13:34 +00:00
Node 24 comes with npm > 11.5.1 which we need in order to publish with OIDC auth. This also reverts the change in commite03a54e, which broke the publishing step. (cherry picked from commitd3d69a8118)
98 lines
3.2 KiB
YAML
98 lines
3.2 KiB
YAML
name: Publish
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
npm:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: |
|
|
GITREV=$(git rev-parse --short HEAD)
|
|
echo $GITREV
|
|
sed -i "s/^\(.*\"version\".*\)\"\([^\"]\+\)\"\(.*\)\$/\1\"\2-g$GITREV\"\3/" package.json
|
|
if: github.event_name != 'release'
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
# Node 24 is needed to get npm > 11.5.1, which is a requirement for
|
|
# OIDC auth.
|
|
node-version: 24
|
|
# Needs to be explicitly specified for auth to work
|
|
registry-url: 'https://registry.npmjs.org'
|
|
- run: npm install
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: npm
|
|
path: lib
|
|
- run: npm publish --access public
|
|
if: |
|
|
github.repository == 'novnc/noVNC' &&
|
|
github.event_name == 'release' &&
|
|
!github.event.release.prerelease
|
|
- run: npm publish --access public --tag beta
|
|
if: |
|
|
github.repository == 'novnc/noVNC' &&
|
|
github.event_name == 'release' &&
|
|
github.event.release.prerelease
|
|
- run: npm publish --access public --tag dev
|
|
if: |
|
|
github.repository == 'novnc/noVNC' &&
|
|
github.event_name == 'push' &&
|
|
github.event.ref == 'refs/heads/master'
|
|
snap:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: |
|
|
GITREV=$(git rev-parse --short HEAD)
|
|
echo $GITREV
|
|
sed -i "s/^\(.*\"version\".*\)\"\([^\"]\+\)\"\(.*\)\$/\1\"\2-g$GITREV\"\3/" package.json
|
|
if: github.event_name != 'release'
|
|
- run: |
|
|
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)
|
|
echo $VERSION
|
|
sed -i "s/^version:.*/version: '$VERSION'/" snap/snapcraft.yaml
|
|
- uses: snapcore/action-build@v1
|
|
id: snapcraft
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: snap
|
|
path: ${{ steps.snapcraft.outputs.snap }}
|
|
- uses: snapcore/action-publish@v1
|
|
with:
|
|
snap: ${{ steps.snapcraft.outputs.snap }}
|
|
release: stable
|
|
env:
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_LOGIN }}
|
|
if: |
|
|
github.repository == 'novnc/noVNC' &&
|
|
github.event_name == 'release' &&
|
|
!github.event.release.prerelease
|
|
- uses: snapcore/action-publish@v1
|
|
with:
|
|
snap: ${{ steps.snapcraft.outputs.snap }}
|
|
release: beta
|
|
env:
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_LOGIN }}
|
|
if: |
|
|
github.repository == 'novnc/noVNC' &&
|
|
github.event_name == 'release' &&
|
|
github.event.release.prerelease
|
|
- uses: snapcore/action-publish@v1
|
|
with:
|
|
snap: ${{ steps.snapcraft.outputs.snap }}
|
|
release: edge
|
|
env:
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_LOGIN }}
|
|
if: |
|
|
github.repository == 'novnc/noVNC' &&
|
|
github.event_name == 'push' &&
|
|
github.event.ref == 'refs/heads/master'
|