Fully Automated npm publish using GitHub Actions and Semantic Release

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ค. 2024
  • Fully automated release!!! semantic-release automates the whole package release workflow including: determining the next version number, generating the release notes and publishing the package.
    This removes the immediate connection between human emotions and version numbers, strictly following the Semantic Versioning specification.
    semantic-release is meant to be executed on the CI environment after every successful build on the release branch. This way no human is directly involved in the release process and the releases are guaranteed to be unromantic and unsentimental.
    GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub.
    Helpful URLs:
    syntax for GitHub Actions: docs.github.com/en/actions/re...
    add ifs in GitHub Actions: docs.github.com/en/actions/re...
    Commitizen: commitizen-tools.github.io/co...
    semantic-release: github.com/semantic-release/s...
    My GitHub repository URL: github.com/bmvantunes/youtube...
    Published Package: www.npmjs.com/package/your-pa...
    Timeline:
    00:00 Introduction
    00:38 Create project using tsdx and git push to GitHub
    01:46 Create our first GitHub Action
    06:50 Setup semantic-release
    11:30 Setup commitizen
    14:34 Create publish job inside GitHub Actions using semantic-release
    22:26 How to handle Pull Requests and Merges in order to keep semantic-release "happy" :)
    ----
    Follow me on:
    Twitter: / bmvantunes
    Dev.to: dev.to/bmvantunes
    Website: brunoantunes.net
    GitHub: github.com/bmvantunes
    LinkedIn: / bmvantunes
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 70

  • @aboubacardiallo9117
    @aboubacardiallo9117 16 วันที่ผ่านมา

    You answered all my questions about versioning with semantic release.
    That’s is an amazing content and I’m going to subscribe right now because I don’t want to miss any content from you 🥰

  • @Wickaruz
    @Wickaruz ปีที่แล้ว

    Thanks Bruno with this tutorial I could integrate semantic-release to my vuejs web project! Big thanks!

  • @fauzi5848
    @fauzi5848 2 ปีที่แล้ว +1

    rich topics, very well explained and a bit funny too 😁
    keep up the good work Bruno 👍

    • @BrunoAntunesPT
      @BrunoAntunesPT  2 ปีที่แล้ว

      I'm soo glad you enjoyed it 😍 thank you for your words 🤗🤗

  • @AlekzyCrixZBlogout
    @AlekzyCrixZBlogout 3 ปีที่แล้ว +3

    This is gold man, keep this on!
    New sub

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว +1

      Thank you very much my friend 😊

  • @mc-ty4br
    @mc-ty4br 3 ปีที่แล้ว +1

    EXACTLY what I was looking for! I followed every step even when I knew that (for example) NPM_TOKEN was missing and it was gonna fail 😅
    Thank you :)

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว

      Awesome mate 😍😍😍 Thank you for your positive vibes 🤗🤗

  • @macieksitkowski
    @macieksitkowski 2 ปีที่แล้ว +2

    Hey Bruno, thank you very much, I learned a ton from your video 🙏

    • @BrunoAntunesPT
      @BrunoAntunesPT  2 ปีที่แล้ว

      Very happy to read that 😍 thank you 🙂

  • @khandoor7228
    @khandoor7228 3 ปีที่แล้ว +1

    Excellent Bruno, life saver!!

  • @devasanishivani3197
    @devasanishivani3197 ปีที่แล้ว

    Helpful. Thanks for all the references links

  • @web_dev_host
    @web_dev_host 2 ปีที่แล้ว +1

    Wonderful video! Learned so many things

    • @BrunoAntunesPT
      @BrunoAntunesPT  2 ปีที่แล้ว

      I'm soo happy to know that ❤️❤️

  • @oleksandr5128
    @oleksandr5128 3 ปีที่แล้ว +1

    That is a great topic, thank you a lot!

  • @mkdierz
    @mkdierz ปีที่แล้ว

    thanks much love ❤

  • @ruijadom
    @ruijadom 3 ปีที่แล้ว +4

    Tens mesmo jeito para ensinar! os teus videos estão top! parabéns!

  • @subhranshudas8862
    @subhranshudas8862 2 ปีที่แล้ว

    Great explanation. Can you please share about how to do the same thing for mono-repos with independent publishable modules?

  • @Senshiii99
    @Senshiii99 2 ปีที่แล้ว

    SIMPLY AMAZING !! ❤

  • @sealuke2724
    @sealuke2724 ปีที่แล้ว

    awesome content!! bro

  • @shivomsrivastava6540
    @shivomsrivastava6540 ปีที่แล้ว

    Thanks Bruno

  • @infoapp7725
    @infoapp7725 3 ปีที่แล้ว +2

    Amazing Bruno!! it works for me, thanks so much
    Do you know if is possible to publish a pre-release package? like a beta or something previous to the final release?
    what should be the commands to do that? thank you

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว +1

      Thank you 😍
      Yes you will need a pre-releass branch for that, but answering directly to your question: yes, it's possible 😊
      They have docs here explaining that process semantic-release.gitbook.io/semantic-release/usage/workflow-configuration#pre-release-branches

  • @leonilima2611
    @leonilima2611 2 ปีที่แล้ว

    Me ajudou muito. Abraços direto do Brasil!

  • @raffaelloringue
    @raffaelloringue 2 ปีที่แล้ว

    thanks for the vid. is it possible to have inside the action more than 1 if. ? For example 1 for main branch and another for dev branch? another question.. what about pushing from visualcode ?

  • @feossandon
    @feossandon 2 ปีที่แล้ว

    Hello Bruno, thanks for the tutorial. I have troubles with NPM_TOKEN during the CI actions process. ""Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token."" but my npm account does not have 2FA enabled, and my generated access token is type ""Automation"". any advice about this problem?

  • @GabrielRodriquesGonzaga
    @GabrielRodriquesGonzaga 2 ปีที่แล้ว

    Nice one :)

  • @adithyakiransekar
    @adithyakiransekar ปีที่แล้ว

    Great video Bruno. I didn't get the last part on why publish was skipped, but you did see the new version 1.1.0 updated in npm? How did that work?

    • @gowsalyar8352
      @gowsalyar8352 11 หลายเดือนก่อน

      The publish was skipped for his feature branch, bcoz he set it up the publish steps in yml file to run only for the main branch.
      So that only the publish steps skipped for his feature branch. And then once the changes merged to main the publish step ran and the npm version updated in npm screen. Hope it's helps to understand.👍

  • @user-nv6qu9bw2t
    @user-nv6qu9bw2t 2 ปีที่แล้ว

    please let me know if you still can publish success. I tried the latest version of seamantic-release and same of verion as your repo, both meet same 403 error.

  • @eduardocarvalho4232
    @eduardocarvalho4232 3 ปีที่แล้ว +1

    Portuguese 🤟🏻
    Awesome work.
    Tens discord ?

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว

      Muito obrigado Eduardo 😍
      Por acaso nao tenho discord... mas 'es a terceira pessoa esta semana a perguntar isso 😊
      Que vantagens ves em usar discord? Desculpa a pergunta completamente noob da minha parte 🤣🤣

    • @eduardocarvalho4232
      @eduardocarvalho4232 3 ปีที่แล้ว +1

      ​@@BrunoAntunesPT O discord é uma app para mobile/desktop/web que te permite criar um "servidor" onde podes convidar amigos, video calls, chamadas de grupo, partilha de ecra, tudo no mesmo servidor sem custo nenhum.
      Faz imensa falta na comunidade portuguesa, já que procuramos sempre contéudo na comunidade Inglesa/Brasileira e assim podiamos criar uma união e partilhar-mos conteúdo em Português com outros Portugueses 😂

  • @TalesMarinho
    @TalesMarinho ปีที่แล้ว

    Can you record a video with the necessary changes to publish a named package on github registry from an organization? It's bein painful here

  • @wacnss
    @wacnss 2 ปีที่แล้ว

    Hello, it's a nice tutorial. Everything is working fine, but once it reaches the release job it falls into a permision error how do I solve it?
    NOTE: I've even used my personal access token which gives all the permisions it needs.

  • @MarcosRCordeiro10
    @MarcosRCordeiro10 3 ปีที่แล้ว

    Hello Bruno. Is there a another way do write routes inside NextJS? I dont like the system namefolders routes
    I want something like "router" from CRA

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว

      Uhmm... You can but you need to create a custom server 😔😔

  • @hattori-kunplays1204
    @hattori-kunplays1204 ปีที่แล้ว

    24:15 did you mean squash and merge will lose the nice commit messages not the Create a merge commit?

  • @mapalchemy7831
    @mapalchemy7831 2 ปีที่แล้ว

    Thanks Bruno, add this in package.json to avoid payment error:
    "publishConfig": {
    "access": "public"
    },

  • @himanshukushwah5211
    @himanshukushwah5211 2 ปีที่แล้ว

    Hey bruno having packages depreciated errors, please help

  • @wilsonbenavides1520
    @wilsonbenavides1520 3 ปีที่แล้ว

    Hello, Bruno could I use this method to share common codes between 2 projects?
    I have 2 react apps that share many functions, selectors, ui components.

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว

      Yes, you can! :)
      We share react components and helpers between multiple teams inside my company. We have a private npm registry so the code is not exposed outside our organization - this might be important (or not) depending on your company...
      We then use storybook both as development playground and documentation - storybook is a pleasure to work with :)

    • @wilsonbenavides1520
      @wilsonbenavides1520 3 ปีที่แล้ว +1

      @@BrunoAntunesPT wow Bruno thanks a lot. I ve been struggling copying and pasting the codes within my projects.
      Do you have a video where you you talk more In detail about this topic?

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว +1

      Yeah, copy pasting works for a while, but as soon as your projects start to grow, it becomes very painful very fast, especially if you have multiple teams with a dozen projects xD
      Well...that was basically my introduction for last weeks video and one of the reasons to make this 2 videos - th-cam.com/video/aVFasPXkyRE/w-d-xo.html
      But if you have any question(s), feel free to ask, and I'll try to help :)

    • @wilsonbenavides1520
      @wilsonbenavides1520 3 ปีที่แล้ว +1

      @@BrunoAntunesPT thanks. I got it.

  • @kavishkasandaruwan3637
    @kavishkasandaruwan3637 2 ปีที่แล้ว

    can i do it without coding

  • @JeffandFantom
    @JeffandFantom ปีที่แล้ว

    How about make about GitLab?

  • @prakashacharya
    @prakashacharya 3 ปีที่แล้ว

    AggregateError:
    SemanticReleaseError: The release branches are invalid in the `branches` configuration.
    I got this error I tried to find the documentation and added the configuration for release branches it does not work.

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว +1

      Can you share your repository? Are you passing the branches like here :
      github.com/bmvantunes/youtube-2021-may-automatic-publish-npm-semantic-release-and-github-actions/blob/1c6d20cd4b92978e8ac40d44f704073fe5ddcfa9/package.json#L25

    • @prakashacharya
      @prakashacharya 3 ปีที่แล้ว +1

      @@BrunoAntunesPT i passed the different branch name I fixed it. Thankyou so much. Appriciate your work.

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว

      Awesome 😀😀

  • @leocaesar2
    @leocaesar2 3 ปีที่แล้ว

    why is my package not appearing in my npm account

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว

      It can take quite a while because of cache 😊
      As long as it says it was published on the terminal 😊

  • @Stefan-xm9qb
    @Stefan-xm9qb 10 หลายเดือนก่อน

    Nice jaw line

  • @henryugochukwu8398
    @henryugochukwu8398 3 ปีที่แล้ว

    Hi Bruno. Awesome work man.
    But I am having an issue when running the publish job. semantic-release seems to be having an issue during publishing. Please help
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! react-paga@0.0.0-development semantic-release: `semantic-release`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the react-paga@0.0.0-development semantic-release script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/runner/.npm/_logs/2021-07-26T01_54_40_871Z-debug.log

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว

      Thank you 😊
      can you copy more of the error? That bit alone doesn't help understand what happened 😊

    • @henryugochukwu8398
      @henryugochukwu8398 3 ปีที่แล้ว +1

      @@BrunoAntunesPT Hi Bruno, thanks for the response. Apparently when I created my npmjs.com account I didn't verify my email address as a result I wasn't granted access to publish my package. But I have resolved it. Thanks

    • @BrunoAntunesPT
      @BrunoAntunesPT  3 ปีที่แล้ว

      @@henryugochukwu8398 that's awesome to read 😍😍😍 I'm very happy you are now able to publish packages ❤️❤️