Skip to content

Commit

Permalink
Fix NPM auto-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisameling committed Sep 16, 2020
1 parent 0c47b33 commit e5d1ee1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 52 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/node.js.pr.yml

This file was deleted.

30 changes: 4 additions & 26 deletions .github/workflows/node.js.yml
@@ -1,14 +1,17 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build and publish Angular library
name: Angular library

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
Expand All @@ -24,28 +27,3 @@ jobs:
- run: npm ci
- run: npm run lint
- run: npm run build:prod

npm-publish:
needs: build
name: Publish to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- run: npm ci
- run: npm run lint
- run: npm run build:prod
- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@1.3.3
with:
tag_name: "v%s"
tag_message: "v%s"
commit_pattern: "^Release (\\S+)" # Only publish when a commit is created that starts with "Release ..."
workspace: "./dist/muuri-angular"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/npm-publish.yml
@@ -0,0 +1,26 @@
name: npm-publish
on:
push:
tags:
- v*.*.*

jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build library
run: npm run build:prod
- name: Publish version
run: cd ./dist/muuri-angular && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 comments on commit e5d1ee1

Please sign in to comment.