Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
Add GitHub Actions To Publish To NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueleite42 committed Dec 22, 2020
1 parent 9e085a3 commit 577342e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish To NPM

on:
release:
types:
- published

jobs:
test:
runs-on: ubuntu-lastest

steps:
- uses: actions/checkout@v2

- name: Install Dependencies
run: |
yarn
- name: Run Tests
run: |
yarn test
prepares-for-publish:
runs-on: ubuntu-lastest

needs: test

steps:
- name: Build
run: |
tsc
- name: Move package.json To Lib Folder
run: |
mv ${{ GITHUB_WORKSPACE }}/package.json ${{ GITHUB_WORKSPACE }}/lib/package.json
publish-to-npm:
runs-on: ubuntu-lastest

steps:
- name: Publish To NPM
uses: pascalgn/npm-publish-action@1.3.6
with:
create_tag: false
workspace: ${{ GITHUB_WORKSPACE }}/lib
publish_command: yarn
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
test:
runs-on: ubuntu-lastest

steps:
- uses: actions/checkout@v2

- name: Install Dependencies
run: |
yarn
- name: Run Tests
run: |
yarn test

0 comments on commit 577342e

Please sign in to comment.