Skip to content
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

Publish NPM beta version on push to main #44

Closed
wants to merge 1 commit into from

Conversation

vgarciabnz
Copy link
Member

This PR adds the capability to publish a beta package to NPMJS registry. This publication only happens on merge to main.

The plugin npm-publish is only used to build the package.json file. The actual publication is done in a separate script that uses npm commands directly.

It depends on NPMJS_TOKEN variable for authentication. This variable is set in DHIS2 organization, but it is not enabled for this repository. It must be enabled before merging to main.

@vgarciabnz vgarciabnz requested a review from jbee January 18, 2024 09:12
# Iterate a maximum of MAX_ITERATION times.
n=1
MAX_ITERATIONS=30
while [ $n -le $MAX_ITERATIONS ]; do
Copy link
Member Author

Choose a reason for hiding this comment

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

The difference between maven snapshots and npmjs beta versions is that snapshots can be uploaded using the same version, but npmjs beta versions cannot. This is solved by trying to upload starting at beta.0; if it fails, continue with beta.1 and so on.

@vgarciabnz vgarciabnz closed this Feb 5, 2024
@vgarciabnz vgarciabnz deleted the npmjs-beta-deploy branch February 5, 2024 12:19
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