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

Adds automated publishing workflow to NPM #306

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

dkastl
Copy link
Contributor

@dkastl dkastl commented Nov 2, 2023

This pull request introduces an automated publishing workflow to NPM for the multiple packages included in this repository.

The motivation behind this PR is to simplify the use of the multiple NPM packages in this repository through NPM. In the release documentation it seemed to me that the publishing process so far was manual, and I thought automation will allow publishing of NPM packages more frequently.

The publishing process is triggered by creating a Git tag and it distinguishs between stable releases and pre-releases by publishing to different NPM channels.
Additionally, the CI creates releases to the dev channel on NPM for every commit to the main branch, so it's easy to stay up-to-date with the latest development.

I tested the workflow successfully until the actual publishing to NPM, which requires to configure a NPM Authentication Token name NPM_TOKEN as Github secret.

Signed-off-by: Daniel Kastl <daniel@georepublic.de>
@hand-dot
Copy link
Collaborator

hand-dot commented Nov 2, 2023

@peteward
I'd like to know your opinion

@hand-dot
Copy link
Collaborator

hand-dot commented Nov 3, 2023

I used to update manually, but it seems good that with this script, development releases can be obtained automatically from the main branch.

I would like to adopt this operation as it seems better.

@hand-dot hand-dot merged commit ec81f4d into pdfme:main Nov 3, 2023
1 check passed
@peteward
Copy link
Collaborator

peteward commented Nov 3, 2023

sorry for the late reply.

Releases are your area @hand-dot, so if you are happy with the process then great.

Thank you very much @dkastl for the contribution! 👍

@hand-dot
Copy link
Collaborator

hand-dot commented Nov 3, 2023

@dkastl

I'm currently trying to release V3 using this workflow, but it fails with an error. The cause of the error seems to be that the new value is not set correctly with npm version, and it tries to publish with a duplicate version, which prevents the publish from happening.

If you have any ideas for a fix, I'd like to hear them.

https://github.com/pdfme/pdfme/actions/runs/6742936403

@hand-dot
Copy link
Collaborator

hand-dot commented Nov 3, 2023

I'm sorry. I didn't understand how to use it.

It seems that 3.0.0-beta.2 already existed, so it was necessary to create the tag from 3.0.1 onwards.

@dkastl
Copy link
Contributor Author

dkastl commented Nov 3, 2023

Sorry, I was not connected to internet today, but I will take a look tomorrow. I'm not sure if NPM requires increasing version numbers for example. It's the part I wasn't able to test properly because changing the NPM organisation causes other issues.

@dkastl
Copy link
Contributor Author

dkastl commented Nov 7, 2023

It took me a bit longer to take a look, but checking the GH Actions and published NPM packages it seems to working now, right?

Thanks a lot for merging! This makes is a lot easier to stay up-to-date with the latest state of development!

@hand-dot
Copy link
Collaborator

hand-dot commented Nov 7, 2023

@dkastl
Yes, working. Thank you👍

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.

3 participants