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

Set up automatic NPM releases #332

Merged
merged 38 commits into from
Jun 29, 2022
Merged

Set up automatic NPM releases #332

merged 38 commits into from
Jun 29, 2022

Conversation

tillsanders
Copy link
Contributor

I've been releasing cookieconsent as vanilla-cookieconsent to the NPM registry for a while and I am still happy to help in any way. However, sometimes I'm a few days behind. Seeing the rising popularity of the project, this unnecessary delay should be eliminated. I would like to offer assistance in setting up an automated release workflow.

As you can see, I've added a workflow with two jobs: one to publish releases under the default latest tag and another to publish releases marked as a pre-release under the next tag. If this PR is accepted, every time you hit the 'Publish release' button on GitHub, the workflow will be triggered and publish the package to NPM automatically.

To set things up with NPM, we need to do a few things once:

  • I will invite you as a maintainer of the NPM Package (I need your NPM username) or hand it over completely
  • You need to generate an access token for NPM and save it in the secrets of this repository under the name NPM_TOKEN
  • Do a quick dry run:
    • Publish a new release for this purpose – no need to change the codebase, just a new release
    • Check if the workflow is triggered and running successfully
    • Remove the release and tag
    • Remove dry-run: true (twice!) from .github/workflows/main.yml

Alternatively, you could also add me as a contributor to the repository, if you don't have an NPM account and don't want to set one up.

On a side note: I believe the package-lock.json should be tracked as well, so I included it in this PR.

Signed-off-by: Till Sanders <mail@till-sanders.de>
Signed-off-by: Till Sanders <mail@till-sanders.de>
Signed-off-by: Till Sanders <mail@till-sanders.de>
Signed-off-by: Till Sanders <mail@till-sanders.de>
Signed-off-by: Till Sanders <mail@till-sanders.de>
…nto orestbida-master

Signed-off-by: Till Sanders <mail@till-sanders.de>

# Conflicts:
#	Readme.md
Signed-off-by: Till Sanders <mail@till-sanders.de>
Signed-off-by: Till Sanders <mail@till-sanders.de>
Signed-off-by: Till Sanders <mail@till-sanders.de>
Signed-off-by: Till Sanders <mail@till-sanders.de>
…nto orestbida-master

# Conflicts:
#	Readme.md
@vercel
Copy link

vercel bot commented Jun 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cookieconsent-docs ❌ Failed (Inspect) Jun 29, 2022 at 8:22AM (UTC)

@orestbida
Copy link
Owner

Awesome!

I think you should stay as a maintainer, since it was you who created the package in the first place, and also kept it up to date. You should be able to find me under the username orestbida.

I also agree on tracking the package-lock.json file!

@orestbida orestbida merged commit 906cb71 into orestbida:master Jun 29, 2022
@tillsanders
Copy link
Contributor Author

Great! I just sent out the invitation so you can complete the setup and accelerate publishing amazing new features ;)

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.

None yet

2 participants