Skip to content

Commit

Permalink
Merge pull request #1 from EYBlockchain/liju.jose/automate-npm-github…
Browse files Browse the repository at this point in the history
…-package

automate npm github package
  • Loading branch information
Westlad authored Aug 28, 2020
2 parents 081b0c0 + c7072a6 commit abc2a59
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/make-github-npm-package.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
name: Node.js Package

on:
push:
branches:
- 'master'
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@master
- uses: codfish/semantic-release-action@master
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: echo ${{ steps.semantic.outputs.release-version }}

# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
- run: npm install
- run: npm publish

- name: publish npm package to github
if: steps.semantic.outputs.new-release-published == 'true'
run: |
npm install
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
branch: 'master',
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
['@semantic-release/npm', { npmPublish: false }],
'@semantic-release/github',
],
};

0 comments on commit abc2a59

Please sign in to comment.