Skip to content

NPM publish CD workflow #19

NPM publish CD workflow

NPM publish CD workflow #19

Workflow file for this run

# Copyright 2020, 2023, Oracle Corporation and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl.
# ---------------------------------------------------------------------------
# Coherence JavaScript Client GitHub Release Actions build.
# ---------------------------------------------------------------------------
name: NPM publish CD workflow
on:
release:
# This specifies that the build will be triggered when we publish a release
types: [published]
jobs:
build:
# Run on latest version of ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.release.target_commitish }}
# install Node.js
- name: Use Node.js 18.15.x
uses: actions/setup-node@v3
with:
node-version: 18.15.x
# Specifies the registry, this field is required!
registry-url: https://registry.npmjs.org/
# install protoc
- run: curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v22.2/protoc-22.2-linux-x86_64.zip"
- run: unzip protoc-22.2-linux-x86_64.zip -d /tmp/grpc
- run: echo "/tmp/grpc/bin" >> $GITHUB_PATH
- run: npm install
# run unit tests
- run: COHERENCE_VERSION=22.06.5 npm run test-cycle
- run: COHERENCE_VERSION=23.09 npm run test-cycle
- run: npm install --no-save typedoc
# generate dist which runs other tasks
- run: npm run dist
# publish to NPM
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }}