Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# only trigger on pull request closed events
on:
pull_request:
types: [ closed ]
name: publish package CI

jobs:
build:
# this job will only run if the PR has been merged
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Use Node.js 14.x
# Setup .npmrc file to publish to GitHub Packages
uses: actions/setup-node@v2
with:
node-version: 14.x
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@cardinalblue'

- name: Install Package
run: yarn
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# we need to setup user email & name to be able to build the package: https://github.com/fregante/setup-git-user
- name: Setup User
uses: fregante/setup-git-user@v1

- name: Build Package
run: yarn build

- name: Publish Package
run: yarn publish
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#authenticating-to-the-destination-repository
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@cardinalblue:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardinalblue/cbjs",
"version": "1.4.8",
"version": "1.4.12",
"description": "Utilities and common functions and classes for TypeScript, React, RxJS projects",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand All @@ -10,7 +10,7 @@
"scripts": {
"test": "jest --config jest.config.js",
"clean": "rimraf lib dist",
"build": "yarn version --patch && tsc",
"build": "tsc",
"p": "yarn publish",
"peers": "install-peers"
},
Expand Down