Skip to content

Commit

Permalink
Refactored npm-publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 committed Oct 28, 2022
1 parent bb2194b commit 6bb0d9b
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Npm Package & Publish
name: 📦 Npm Package & Publish

on:
workflow_dispatch:

release:
types: [published]
workflow_run:
workflows: ["tagged-release"]
types:
- completed
- completed

jobs:
build:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand All @@ -32,9 +26,10 @@ jobs:
cache-dependency-path: package-lock.json
node-version-file: .nvmrc

- name: Build
- name: Setup Project
run: npm ci
- name: Test

- name: 📋 Run Tests
run: npm test

publish-npm:
Expand All @@ -51,8 +46,10 @@ jobs:
cache-dependency-path: package-lock.json
node-version-file: .nvmrc

registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
- name: Setup Project
run: npm ci

- name: Npm Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit 6bb0d9b

Please sign in to comment.