Skip to content

Commit

Permalink
NPM publish step
Browse files Browse the repository at this point in the history
  • Loading branch information
epessina committed Dec 3, 2024
1 parent d71b441 commit d95f562
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ jobs:

build:
uses: ./.github/workflows/build.yml

npm-publish:
if: github.ref_type == 'tag'
needs:
- tests
- lint
- build
uses: ./.github/workflows/publish.yml
secrets:
token: ${{ secrets.NPM_TOKEN }}

34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish

on:
workflow_call:
secrets:
token:
required: true

jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false

- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: .nvmrc
check-latest: true
cache: npm

- name: Download Build Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: build
path: dist

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

0 comments on commit d95f562

Please sign in to comment.