Skip to content

Commit

Permalink
Merge pull request #25 from disha-148/main
Browse files Browse the repository at this point in the history
Updated pipeline to trigger on PR merge and publish all packages to npmjs
  • Loading branch information
morningspace authored Jan 16, 2025
2 parents 5c9887a + 3b1d696 commit 8a58618
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Publish to npmjs
name: Publish to npmjs on PR merge

on:
push:
pull_request:
types:
- closed
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true

defaults:
run:
Expand All @@ -20,15 +23,15 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Configure npm for lerna
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Set up Git user
run: |
git config --global user.name "github-actions[bot]"
Expand All @@ -38,9 +41,9 @@ jobs:
# run: npx lerna bootstrap

# - name: Run testsnpx lerna bootstrap
# run: npx lerna run test
# run: npx lerna run test

- name: Publish packages
run: npx lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 5 additions & 1 deletion packages/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "root",
"license": "MIT",
"private": "true",
"workspaces": [
"*"
"@instana-integration/*"
],
"dependencies": {
"lerna": "^8.1.3"
Expand All @@ -10,3 +12,5 @@
"lerna": "^8.1.3"
}
}


0 comments on commit 8a58618

Please sign in to comment.