-
Notifications
You must be signed in to change notification settings - Fork 70
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
chore: esbuild artifacts #1030
chore: esbuild artifacts #1030
Conversation
with: | ||
node-version: ${{ inputs.nodeVersion }} | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install esbuild Dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These dependencies are required by esbuild
} | ||
|
||
// Remove 'prepack' and 'prepare' scripts | ||
if (packageJson.scripts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two fields are deleted because it will block the publishing process of esbuild.
|
||
// Update package name if necessary | ||
if (packageJson.name && packageJson.name === '@salesforce/core') { | ||
packageJson.name = '@salesforce/core-bundle'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
produce a separate package called core-bundle.
yarn add esbuild-plugin-tsc@^0.4.0 -D | ||
- name: Install All Dependencies | ||
run: | | ||
yarn install --network-timeout 600000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
within our actions we have https://github.com/salesforcecli/github-workflows/blob/main/.github/actions/yarnInstallWithRetries/action.yml which has retry logic wrapped around it. That reduces network/cache errors from yarn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I just polish it according to your suggestion!
node scripts/build.js | ||
- name: Publish a Package | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work, but if it does make sure the token isn't included in the logs.
IIRC, we use actions/setup-node
which writes NODE_AUTH_TOKEN
to the npmrc file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the .npmrc method first but it did not work properly. I am sure it won't display in the logs. Here is an example in my forked repo. https://github.com/mingxuanzhangsfdx/sfdx-core/actions/runs/7955097070/job/21713519127#step:10:1
What does this PR do?
This PR creates a github workflow to make esbuild transpile the project and then publish a package @salesforce/core-bundle to npm.
It should be merged after #1026
W-15022848
What issues does this PR fix or reference?
@W-15022848@