Skip to content

v0.0.60

v0.0.60 #73

Workflow file for this run

name: Publish NPM
on:
release:
types: [created]
env:
DIST_FOLDER: dist
PACKAGE_NAME_COMMON: ngds-common
PACKAGE_NAME_FORMS: ngds-forms
jobs:
package:
name: "Publish to NPM"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
scope: "@digitalspace"
- uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
### Install if no cache exists ###
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- run: yarn install --silent --frozen-lockfile
### Build if no cache exists ###
- name: Cache Build
id: cache-build
uses: actions/cache@v3
with:
path: |
**/dist
key: ${{ github.sha }}-dist
- name: Run Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: |
yarn build
yarn build $PACKAGE_NAME_FORMS
- run: git config --global user.email ${{ secrets.EMAIL }}
- run: git config --global user.name ${{ secrets.USERNAME }}
- run: cd $DIST_FOLDER/PACKAGE_NAME_FORMS && npm version ${{ github.ref_name }}
- run: cd $DIST_FOLDER/PACKAGE_NAME_FORMS && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}