Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

feat: automagic version & publish when go-ipfs released #35

Merged
merged 21 commits into from Jul 9, 2019
Merged

feat: automagic version & publish when go-ipfs released #35

merged 21 commits into from Jul 9, 2019

Conversation

olizilla
Copy link
Contributor

@olizilla olizilla commented May 31, 2019

The motivation here is to remove any friction around testing out new and upcoming go-ipfs releases against our js based apps, to catch an compatibility issues as soon as possible. The other side of this effort is #34 which will let projects manually override the go-ipfs version to use. If we automated the publishing of this module so that all releases and release-candidates of go-ipfs have an equivalent version of go-ipfs-dep on npm, the we could drop the manual override feature, and just tell folks us the dependancy version number.

This is a proof of concept to show that we can automate the process of keeping this module up to date with go-ipfs.

  • It pulls the lates go-ipfs release version from https://dist.ipfs.io/go-ipfs/versions and compares it to the local package.version every hour (configurable)
  • when dist.ipfs.io updates with a new release it installs the deps, runs the tests, as a sanity check
  • It'll then run npm version $LATEST using the new release number from go-ipfs to keep them in sync, and then npm publish.
  • It needs a github token (provided by the action) to commit the version incrment in package.json back to the repo
  • needs an npm token to publish with, and the account that it comes from can have 2fa enabled but not only on login, not on publish.

of note, in it's current form this will publish whatever version go-ipfs publish, including release candidates. I'm all in favour or publishing release candidates here though.

also of note, it could be collapsed into a single github action, but it's kinda nice to see green checks in the github UI for each step:

  • check for new version
  • build
  • test
  • version & publish

fixes #32

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla
Copy link
Contributor Author

olizilla commented May 31, 2019

Sensible next steps

  • create an npm deploy account with acess to just this project, and create an auth token
  • test that the version we find from dist is valid semver, bail if not
  • detect rc releases and other semver prerelease labels, and publish to npm with next as the dist tag

@olizilla
Copy link
Contributor Author

Oooh the robot just did it's first release!

https://www.npmjs.com/package/@olizilla/go-ipfs-dep

I am so proud 🤖✨

@daviddias
Copy link
Contributor

@olizilla awesome work! 👏🏽👏🏽👏🏽

@momack2 momack2 requested a review from Stebalien June 3, 2019 16:29
Copy link
Contributor

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

👍 ❌ 💯

detect rc releases and other semver prerelease labels, and publish to npm with next as the dist tag

I'd do this before merging. RCs frequently contain pretty nasty bugs.

@olizilla
Copy link
Contributor Author

olizilla commented Jun 4, 2019

Agreed! and DONE!

It'll publish pre-releases (any semver string with a - in) under go-ipfs-dep@next while stable releases are published under go-ipfs-dep@latest, so running npm install go-ipfs-dep will always get you a stable release.

uses `npx semver` to check that the string we scrape from dist.ipfs.io
is a valid semver string before trying to publish to it.

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla
Copy link
Contributor Author

olizilla commented Jul 3, 2019

Ok this now has

  • strict semver checking - to ensure that the value we scrape from dist.ipfs.io is a real semver string
  • Set the npm dist tag to next where the new semver string contains a - and denotes a pre-release.

Only thing we need now is to

  • create an npm deploy account,
  • add that user to the list of users who can publish to this module
  • create an npm auth token and add it to the publish action in the workflow that this PR adds.

@daviddias do we have an npm release bot already? or should I create one?

@olizilla olizilla marked this pull request as ready for review July 3, 2019 12:14
@daviddias
Copy link
Contributor

@daviddias do we have an npm release bot already? or should I create one?

AFAIK, we never had one nor there was ever work towards it, so please be my guest :) Thank you!

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla olizilla merged commit 2a22a0a into ipfs-inactive:master Jul 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish go-ipfs release candidates
4 participants