Skip to content

Pass x-initiator header #167

Pass x-initiator header

Pass x-initiator header #167

Workflow file for this run

name: CI
on:
push:
tags:
- "v*.*.*"
pull_request:
branches:
- master
jobs:
setup:
name: Set up
runs-on: ubuntu-20.04
steps:
- name: Cancel previous workflow runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Setup Node.js
shell: bash -l {0}
run: nvm install
- name: Restore cache
uses: c-hive/gha-npm-cache@v1
- name: Install dependencies
run: npm ci
build:
name: Build
needs: setup
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Setup Node.js
shell: bash -l {0}
run: nvm install
- name: Restore cache
uses: c-hive/gha-npm-cache@v1
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build
tests:
name: Unit Tests
needs: setup
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Setup Node.js
shell: bash -l {0}
run: nvm install
- name: Restore cache
uses: c-hive/gha-npm-cache@v1
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:ci
publish:
name: Publish package
needs:
- setup
runs-on: ubuntu-20.04
if: contains(github.ref, 'refs/tags/')
steps:
- name: Load current commit
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Read nvmrc
id: read-nvmrc
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
shell: bash
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ steps.read-nvmrc.outputs.version }}
- name: Install dependencies
run: npm ci
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ steps.read-nvmrc.outputs.version }}
registry-url: "https://registry.npmjs.org"
- name: Publish package
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLIC_NPM_KEY_PUBLISHING }}