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

ci: cleanup release workflow #218

Merged
merged 8 commits into from
Jan 15, 2021
Merged

ci: cleanup release workflow #218

merged 8 commits into from
Jan 15, 2021

Conversation

derberg
Copy link
Member

@derberg derberg commented Jan 13, 2021

This is a specific PR where we will not only introduce workflows that are core for this project, but also workflows that will be managed by global config in .github repo. The reason is = to test those workflows in a complex project before we know we can roll it out to others

Changes proposed in this pull request:

The files that you can ignore in review as they are marked with a comment as global and they are 1:1 taken from this and that PR:

  • .github/workflows/if-nodejs-pr-testing.yml
  • .github/workflows/if-nodejs-release.yml
  • .github/workflows/if-nodejs-version-bump.yml
  • .github/workflows/issues-prs-notifications.yml
  • .github/workflows/release-announcements.yml

  • issue of having specific npm run bootstrap solved with usage of npm lifecycle script, postinstall that is always triggered after installation of the package. So after doing npm install this is what I can see now

    wookiee@Lukaszs-MacBook-Pro asyncapi-react (master) $ npm install
    
    > undefined postinstall /Users/wookiee/sources/asyncapi-react
    > npm run bootstrap
    
    
    > @ bootstrap /Users/wookiee/sources/asyncapi-react
    > lerna bootstrap
    

    don't worry about undefined , it is because root package.json has no version and no name

  • issue with additional steps for web component and playground mitigated and moved to a separate workflow that reacts on release event

  • issue with specific npm run build-library and npm run build-webcomponent mitigated with prepublishOnly script that triggers both

  • and version bump can be done in global workflow for bumps by introducing

        "bump:playground:version": "cd playground && npm --no-git-tag-version --allow-same-version version $VERSION",
        "bump:webcomp:version": "cd web-component && npm --no-git-tag-version --allow-same-version version $VERSION",
        "bump:lib:version": "cd library && npm --no-git-tag-version --allow-same-version version $VERSION",
        "bump:version": "npm run bump:lib:version && npm run bump:webcomp:version && npm run bump:playground:version"
    

@derberg
Copy link
Member Author

derberg commented Jan 13, 2021

don't worry about failing job about PR notification - it is because on PR from fork I cannot modify PR workflow and expect to have access to secrets

.github/workflows/release-wc-and-playground.yml Outdated Show resolved Hide resolved
- name: Install latest version of library in the web-component
# sleep for 60 seconds before using latest version in web-component, because sometimes NPM needs additional few seconds to `save` package in registry
run: |
sleep 1m
Copy link
Member

Choose a reason for hiding this comment

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

As I understand, this script will run parallel with if-nodejs-release.yml and for that we have 1m sleep? Another question: What about bumping versions? As I understand from scripts, we will have 2 extra commits with bumps on master: first for react-component, then for playground and web-component, yes?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sleep was there already, we needed it no matter if it is in the release workflow or here in the new one.
They do not run in parallel. The release is first as it is triggered by the push to master. This workflow starts when the last step of the release finish (GitHub release creation). In theory, no sleep needed, but you remember we had this problem with "moment of publish to npm" vs "when it is actually available for install"

Copy link
Member

Choose a reason for hiding this comment

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

So if-nodejs-release.yml and release-wc-and-playground.yml won't be triggered in this same time?

Copy link
Member Author

Choose a reason for hiding this comment

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

tl;dr no 😄

if-nodejs-release.yml is triggered on push to master, and release-wc-and-playground.yml on release. So the 2nd one will be triggered once this creates a release


while writing this comment I realized release-wc-and-playground.yml is now triggered on push and not release 😅 pushing fix in a minute

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 🥇

fmvilas
fmvilas previously approved these changes Jan 14, 2021
@derberg
Copy link
Member Author

derberg commented Jan 14, 2021

@magicmatatjahu I just pushed a fix for the problem of not saving in git info about latest react component used in web component and playground. What do you think?

@magicmatatjahu
Copy link
Member

@derberg As I see, you run install:reactcomp in two workflows: release-wc-and-playground and here https://github.com/asyncapi/asyncapi-react/pull/218/files#diff-ef4f20ad9ac611c67466a8f25e69c3924ed476b297b5dd67f54829c012ea3a00R29 This is how it works?

@derberg
Copy link
Member Author

derberg commented Jan 14, 2021

@magicmatatjahu yes, in the workflow about release it is needed for release purpose, but this information is not later pushed to the repo. This is what the other workflow does

@derberg
Copy link
Member Author

derberg commented Jan 14, 2021

@magicmatatjahu if you are waiting for Testing pull request with approval, then don't as I removed this check with this PR 😄

magicmatatjahu
magicmatatjahu previously approved these changes Jan 14, 2021
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@derberg derberg merged commit a00fcc9 into asyncapi:master Jan 15, 2021
@derberg derberg deleted the new-release branch January 15, 2021 09:56
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.18.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.

4 participants