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

Add npm publish workflow #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

LauraBeatris
Copy link
Contributor

@LauraBeatris LauraBeatris commented Aug 9, 2020

This PR adds a github actions workflow to publish the package to NPM on every new release.

We would just need to worry about bumping the version and then creating a new release. The workflow will run the steps to make sure that the build is working as expected and publish it to NPM.

@LauraBeatris
Copy link
Contributor Author

LauraBeatris commented Aug 9, 2020

We should also add the dependabot integration to this repo, it'll create a new PR to every new release of the dependencies used in the apollo-sentry-helper package.

The coolest thing is that we're able to add reviewers to avoid breaking changes when merging these updates, and other kinds of stuff, like labels.

Screen Shot 2020-08-08 at 21 59 36

- name: Install dependencies
run: yarn install

- name: Build
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't we missing a bump step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I'll add it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added 6a7e668

@LauraBeatris
Copy link
Contributor Author

Flux:

  • A PR is merged to the master branch - The bump version workflow will run
  • A new release is created - The npm publish workflow will run

@gabrielpra1
Copy link
Member

Flux:

  • A PR is merged to the master branch - The bump version workflow will run
  • A new release is created - The npm publish workflow will run

Isn't it better to publish to NPM when there is a new release? So we have better control over our publish and over our versions.

For example if we have 2 MRs ready to be merged, we don't need to send 2 new versions to NPM, we may want to release them together.

- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 10.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use node 12?

@pedro-lb
Copy link
Contributor

We need to specify release tags

image

@LauraBeatris
Copy link
Contributor Author

Flux:

  • A PR is merged to the master branch - The bump version workflow will run
  • A new release is created - The npm publish workflow will run

Isn't it better to publish to NPM when there is a new release? So we have better control over our publish and over our versions.

For example if we have 2 MRs ready to be merged, we don't need to send 2 new versions to NPM, we may want to release them together.

@gabrielpra1

A new release is created - The npm publish workflow will run

The workflow that will publish the package will only run after a release be published on the github repo. Refer to the action:

on:
  release:
    types: [published]

We also would need to have a branch for staging, in order to merge the pull requests of dependabot, and just merge it for new releases. Every merge to the master branch will trigger the workflow responsible to bump the package version.

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