Skip to content

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

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 2 commits into from
Jan 22, 2025
Merged
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
20 changes: 8 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@ jobs:
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
- name: Install dependencies, update lock file, and set up Git user
run: |
npm install --package-lock-only
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will update the package-lock.json every time when something is changed. May I know what will trigger such update?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update to package-lock.json is triggered when there is a mismatch between the package.json file and the current state of the package-lock.json.

git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add package-lock.json
git commit -m "Update package-lock.json" || echo "No changes to commit"
git push
npm ci

# - name: Bootstrap packages
# run: npx lerna bootstrap

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

- name: Publish packages
run: npx lerna publish from-package --yes
Expand Down
Loading