Skip to content

Commit

Permalink
ci: Publish on release (#1)
Browse files Browse the repository at this point in the history
Publish to npm when publishing a release on github
  • Loading branch information
a179346 authored Sep 17, 2024
1 parent 2cf6903 commit 12c4e8c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Packages
on:
release:
types: [published]

jobs:
publish-npm-packages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Install Dependencies
run: npm ci

- name: Publish Packages
run: npx lerna publish ${{ github.event.release.tag_name }} --yes --no-push --no-git-tag-version
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
},
"targetDefaults": {
"lint": {
"dependsOn": [
"^build"
],
"inputs": [
"public"
],
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"lint": "lerna run lint",
"build": "lerna run build",
"test": "lerna run test",
"new-version": "lerna version",
"prepack": "npm test",
"publish-packages": "lerna publish from-package --yes"
"prepack": "npm test"
},
"workspaces": [
"packages/*"
Expand Down

0 comments on commit 12c4e8c

Please sign in to comment.