Skip to content

Add @hawk.so/core to npm publish #185

Open
Reversean wants to merge 3 commits intodocs/core-readmefrom
ci/core-publish
Open

Add @hawk.so/core to npm publish #185
Reversean wants to merge 3 commits intodocs/core-readmefrom
ci/core-publish

Conversation

@Reversean
Copy link
Copy Markdown
Member

Extends the CI publish workflow to publish @hawk.so/core to npm alongside @hawk.so/javascript.

Also bumps actions/checkout from v2 to v4 in both workflow jobs.

Also moves @hawk.so/core from a dev dependency to a runtime dependency in @hawk.so/javascript (see #180).

@neSpecc neSpecc requested a review from Copilot April 29, 2026 14:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Extends the npm publish GitHub Actions workflow to publish @hawk.so/core alongside @hawk.so/javascript, and updates @hawk.so/javascript to depend on @hawk.so/core at runtime (reverting the temporary approach from #180).

Changes:

  • Move @hawk.so/core from devDependencies to dependencies in packages/javascript.
  • Publish @hawk.so/core to npm in .github/workflows/npm-publish.yml before publishing @hawk.so/javascript.
  • Bump actions/checkout from v2 to v4 in the publish + notify jobs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/javascript/package.json Makes @hawk.so/core a runtime dependency of @hawk.so/javascript.
.github/workflows/npm-publish.yml Publishes @hawk.so/core in CI and updates checkout action version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- run: yarn
- run: yarn lint-test
- run: yarn build:all
- run: yarn workspace @hawk.so/core npm publish --access=public
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

The workflow now always attempts to publish @hawk.so/core on every push to master. After the first successful publish, subsequent runs will fail if packages/core/package.json version hasn’t been bumped (npm rejects republishing the same version), which would block publishing @hawk.so/javascript as well.

Consider making the core publish step conditional/idempotent (e.g., skip if the version already exists on npm, or only run when packages/core changed / its version changed). Alternatively, publish via a tool/process that handles multi-package releases and versioning consistently.

Suggested change
- run: yarn workspace @hawk.so/core npm publish --access=public
- name: Check whether @hawk.so/core version is already published
id: core_publish_check
run: |
PACKAGE_NAME=$(node -p "require('./packages/core/package.json').name")
PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version")
if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version >/dev/null 2>&1; then
echo "should_publish=false" >> "$GITHUB_OUTPUT"
else
echo "should_publish=true" >> "$GITHUB_OUTPUT"
fi
- if: steps.core_publish_check.outputs.should_publish == 'true'
run: yarn workspace @hawk.so/core npm publish --access=public

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added version auto-bump on PR. Bump level determined by commit message.

Reversean and others added 2 commits April 30, 2026 22:52
Added CI workflows that check if versions of packages core and javascript should be bumped.

Bump level depends on commit message:
- major - '!' after type or body contains 'BREAKING CHANGES' string
- minor - commit of type 'feat'
- patch - otherwise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants