Skip to content

Commit

Permalink
Merge pull request #14 from CoditEU/feature/ci-publish
Browse files Browse the repository at this point in the history
πŸ‘·β€β™‚οΈ added ci build
  • Loading branch information
THMKAE authored Mar 11, 2021
2 parents 94936dc + d21f481 commit 0c370de
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: NPM publish

on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: 'Package version'
required: true
default: v2.0.0

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set version for release trigger
uses: allenevans/[email protected]
if: ${{ github.event_name == 'release' }}
with:
PACKAGE_VERSION: ${{github.event.release.tag_name}}
- name: Set version for workflow dispatch
uses: allenevans/[email protected]
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
PACKAGE_VERSION: ${{ github.event.inputs.version }}
- uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm version ${{env.PACKAGE_VERSION}}
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 0c370de

Please sign in to comment.