Skip to content

Commit

Permalink
add publish to gh and npm
Browse files Browse the repository at this point in the history
  • Loading branch information
tphummel committed Jan 19, 2024
1 parent 03b559f commit 3e813c7
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ main ]

jobs:
build:
test:
runs-on: ubuntu-latest

strategy:
Expand All @@ -27,3 +27,28 @@ jobs:

- name: Run Tests
run: npm test

publish:
needs: build
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Publish to GitHub Packages
uses: actions/setup-node@v3
with:
registry-url: https://npm.pkg.github.com/
node-version: current
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Publish to npm
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/
node-version: current
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 3e813c7

Please sign in to comment.