Skip to content

Updated pipeline to trigger on PR merge and publish all packages to npmjs #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}


Loading