This repository has been archived by the owner on Oct 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions To Publish To NPM
- Loading branch information
1 parent
9e085a3
commit 577342e
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters