-
Notifications
You must be signed in to change notification settings - Fork 1
Added github workflow to support NPM publish on merge #3
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
base: main
Are you sure you want to change the base?
Conversation
.github/workflows/publish-to-npm.yml
Outdated
| - main | ||
| - develop | ||
| - epic/** |
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.
If we do not want to support auto publish on develop and epic branches, we can always change this
.github/workflows/publish-to-npm.yml
Outdated
| elif [ "$target_branch" == "develop" ]; then | ||
| if [[ "${{ steps.get_version.outputs.version }}" =~ beta ]]; then | ||
| version_tag="beta" | ||
| else | ||
| echo "Will not publish. Version on branch \"$target_branch\" is not beta."; | ||
| exit 0; | ||
| fi | ||
|
|
||
| elif [[ $target_branch == epic/* ]]; then | ||
| if [[ "${{ steps.get_version.outputs.version }}" =~ alpha ]]; then | ||
| version_tag="alpha" | ||
| else | ||
| echo "Will not publish. Version on branch \"$target_branch\" is not alpha."; | ||
| exit 0; | ||
| fi |
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.
This block automatically publishes alpha and beta versions based on the branch involved. This will be helpful to test the features before releasing the stable version.
If this is not needed, we can always comment out these blocks for the time being.
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 see. Is the epic concept something you guys use on the mesh cli? Could probably comment that out for now, I imagine we will mostly just use main and develop before Summit.
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.
Sure Ill comment it out
| if: ${{ steps.verify_version.outputs.version_tag != '' }} | ||
| uses: JS-DevTools/npm-publish@v1 | ||
| with: | ||
| token: ${{ secrets.ADOBE_BOT_NPM_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.
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. Will you start that process for us?
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.
They usually expect the repo owners or code owners to do it. I can help you with the required steps but you will have to initiate the process.
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.
OK cool. No worries. Let me know how to kick that off and I will.
| node-version: 18 | ||
|
|
||
| - name: Yarn install | ||
| run: yarn install --frozen-lockfile |
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.
Looks like I didn't include a yarn.lock or package-lock.json. Do you have preference? Seems like mesh probably uses 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.
Yeah we use yarn. Its not necessary to do it that way. I left it so we could discuss. Hence I left the PR as a draft. Once we decide what to do, ill apply the changes and convert the PR to ready.
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 have added the yarn.lock file to this PR. Having it will ensure that the package published will be same as the version we tested locally.

Description
Added github workflow to support NPM publish based on based branch of the closed PR
Related Issue
TBD
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: