Skip to content

Add npm publish workflow#2

Open
LauraBeatris wants to merge 4 commits intojungsoft:masterfrom
LauraBeatris:add-publish-workflow
Open

Add npm publish workflow#2
LauraBeatris wants to merge 4 commits intojungsoft:masterfrom
LauraBeatris:add-publish-workflow

Conversation

@LauraBeatris
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread .github/workflows/npm-publish.yaml Outdated
- name: Install dependencies
run: yarn install

- name: Build
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

We need to specify release tags

image

@LauraBeatris
Copy link
Copy Markdown
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