-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update publish-to-npm workflow to accommodate alpha and beta packages #126
Update publish-to-npm workflow to accommodate alpha and beta packages #126
Conversation
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.
Dude, this is nice work. This is what we were craving for. This helps soo much.
Have you tested this feature? Code wise it all looks good.
version_tag="latest" | ||
|
||
elif [ "$target_branch" == "develop" ]; then | ||
if [[ "${{ steps.get_version.outputs.version }}" =~ beta ]]; then |
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 am new to this, so can you confirm if this is checking for beta
in the version string from get_version
step?
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 dont think we should move forward with publishing if the version string does not have beta
in case of merge to develop
and alpha
in case of epic/*
branches.
During a publish the tag should match the version
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 believe this checks if the version is beta
if merged to develop
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, that's the intention here. If it's the develop
branch, it will only publish if the version has beta
in it. Additionally, it will append the beta tag to the publish.
If you don't want to publish, then don't make it a beta
version.
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 good to me!
I did my best to test this on a |
Description
Problem
Currently, we don't have the ability to publish the CLI plugin to npm unless we merge our code changes to
main
. In the case of testing on thedevelop
branch, as well as on epic branches, we don't want to have to merge incomplete changes tomain
for the sake of a publish. It's worth noting that most team members don't have permission to publish directly to the Adobe organization from their local machine, nor do we want to get into the practice of doing so.Additionally, we don't have a dynamic way to add a tag to a publish even if we DID want to merge to main. The current process involves committing the tag in the workflow file and later reverting it. Failure to add the tag results the in publish being tagged as
latest
and automatically being installed on the next AIO update (which is bad).Propsal
develop
branch will attempt a publish as abeta
packagerelease/*
branch if we adopt that workflowepic/*
branch will attempt a publish as analpha
packageCaveat
Opening up publishing from branches other than
main
can be error prone with regard to versioning (we don't want to publish the wrong branch as alatest
version).As such, this PR enforces the following:
package.json
file MUST include the appropriate suffix in accordance to the tag it will be published withalpha
,beta
,latest
) depending on the branch the PR was merged toExample
A PR merge to the
epic/cloudflare
branch must be versioned asx.x.x-alpha[.x]
, and will automatically assume thealpha
tag when published.Publish to npm
step of the workflow being skipped.How Has This Been Tested?
Manually triggering the workflow.
Additional testing will be performed as the workflow is merged to various branches.
Screenshots (if appropriate):
Checklist: