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

feat: add new release workflow with automated release publishing #242

Merged
merged 70 commits into from Mar 18, 2020
Merged

feat: add new release workflow with automated release publishing #242

merged 70 commits into from Mar 18, 2020

Conversation

derberg
Copy link
Member

@derberg derberg commented Mar 6, 2020

Fixes: #225
See also: #220

  • This PR introduces conventional commits and a short cheat sheet to follow for those that are new to this specification

  • there is now a separate contribution guide that explains how PR titles should look like

  • PR template with info about contribution guide and PR description structure

  • makefile and release.sh removed, docker build added to npm script and rest moved to github action. We no longer use custom docker image for extracting npm version, but we do it in a "npm native way", look into new special script for it

  • New workflow is very descriptive now and all clear what is happening
    Screenshot 2020-03-13 at 17 44 37

  • Once we successfully release to NPM, nice GitHub release is added:
    Screenshot 2020-03-06 at 23 55 24

  • Also bump in package.json is done and change commit by bot. Keep in mind that because of branch protection it is not direct commit, but branch -> pull request -> automerge flow
    Screenshot 2020-03-06 at 23 27 19

  • npm and github publishing is done with support of semantic-release and its plugins that are configured explicitly for conventional commits. If commit message is not feat or fix or has no ! then no release is triggered

  • if you will make sure that title of PR is ok, then you can easily squash then as squash&marge will take PR title as commit message

What failed in this task:

  • I wanted to have automated PR title validation that could be a required check on a PR. Unfortunately the only, good enough actions that are out there are not a good fit for "fork" flow because they both do POST operations on the API, and it won't work starter-workflow template gives Resource not accessible by integration actions/labeler#12 (comment). Only custom basic Action could work that I would have to write from scratch, but imho this is to much for this task
  • I wanted to have automated merging of PR through adding a label to the PR but it can't work on forks for the same reason as above mentioned :( automerging for all PRs, where only you as maintainer have rights to label PR automerge and it is merged, so even maintainers do not have to have write access to repo. Anyway, that failed because of GH actions limitation

Release flow diagram:
Automated release pipeline(1)

@derberg derberg changed the title chore: add new release workflow chore: add new release workflow with automated release publishing Mar 6, 2020
Copy link
Sponsor Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

Just a small question, otherwise looks good 😄

package.json Outdated
@@ -1,5 +1,5 @@
{
"name": "asyncapi-generator",
"name": "@asyncapi/asyncapi-generator",
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Now that we are changing the name shouldn't the name just be @asyncapi/generator ? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Yup, agree with @jonaslagoni. Also, we need to make it clear what happens with the package asyncapi-generator. Should we leave this change for another PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeap, makes a lot of sense, good 👁 @jonaslagoni

@fmvilas not much to do here, in my opinion, once we merge this PR and @asyncapi/generator gets published, we should deprecate asyncapi-generator with clear message what is the new one and that we do not do versioning from the very beginning but continue, something like https://www.npmjs.com/package/babel

Copy link
Member

Choose a reason for hiding this comment

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

Ok, as far as you don't forget to deprecate the current package, everything is fine :)

Let's also put it in the newsletter and make sure @evamorcillo communicates it on social networks too.

Copy link
Member Author

Choose a reason for hiding this comment

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

I anyway want to clearly explain tomorrow during community call how automated flow will look like, and what changes it brings, so it is better to understand for all and we can share details easily by sharing a link to the recording

Copy link
Member

Choose a reason for hiding this comment

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

That's a great idea 👍

@derberg
Copy link
Member Author

derberg commented Mar 16, 2020

@fmvilas @jonaslagoni version changed, conflicts solved

@derberg derberg mentioned this pull request Mar 16, 2020
Copy link
Sponsor Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

👍

@derberg derberg changed the title chore: add new release workflow with automated release publishing feat: add new release workflow with automated release publishing Mar 16, 2020
if: steps.initversion.outputs.version != steps.extractver.outputs.version
run: |
echo ${{secrets.DOCKER_PASSWORD}} | docker login -u ${{secrets.DOCKER_USERNAME}} --password-stdin
npm run docker-build

Choose a reason for hiding this comment

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

Just wanted to re-iterate that for the docker build I did not mean we should use npm to run it [ https://github.com//issues/220#issuecomment-589755835 ].

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeap I know, but I created this npm script for build as par my comment #220 (comment) because docker build part is useful on local development. So better have one script for that for local and CI

Copy link
Member

@fmvilas fmvilas left a comment

Choose a reason for hiding this comment

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

:shipit: 💪

@derberg
Copy link
Member Author

derberg commented Mar 18, 2020

ok, keep fingers crossed so after merge nothing 💥

  • secrets checked, they are defined in a repo with technical bot
  • docker is configured to go to asyncapi account
  • npm goes to new @asyncapi/generator

I merge and if all goes well, we should get a 0.34.0 automatically released 🤞

@derberg derberg merged commit 4d24022 into asyncapi:master Mar 18, 2020
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.34.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start using Conventional Commits spec and automate releases
5 participants