Skip to content

Conversation

@revanth0212
Copy link
Collaborator

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Comment on lines 6 to 8
- main
- develop
- epic/**
Copy link
Collaborator Author

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

Comment on lines 41 to 55
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
Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

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 }}
Copy link
Collaborator Author

@revanth0212 revanth0212 Jan 21, 2025

Choose a reason for hiding this comment

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

There is a process to get this Org Managed token. Ill try to find it tomorrow and update you on it. The process takes around a week, better to get started on it ASAP.

Sample:
image

Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

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.

2 participants