lerna icon indicating copy to clipboard operation
lerna copied to clipboard

Question: publish canary and version

Open iroy2000 opened this issue 4 years ago • 2 comments

I'm trying to do lerna publish --canary in my CI/CD

I'm seeing the "number" after "alpha" is not bumped up (look at the 2nd and 3rd are both alpha.1 )

0.1.3-alpha.0+34fcd0a

0.1.3-alpha.1+d9a9ecb

0.1.3-alpha.1+ezacf1c

How can I make sure that everytime the canary publish can bump up the number after alpha ?

0.1.3-alpha.0+{someSHA}

0.1.3-alpha.1+{someSHA}

0.1.3-alpha.2+{someSHA}

0.1.3-alpha.3+{someSHA}

iroy2000 avatar Jan 15 '22 06:01 iroy2000

👍 This would be very beneficial for my flow as well. 🤔

I was following this guide: https://johnny.sh/notes/publish-canary-lerna-cicd/ where he proposes using

lerna publish prerelease --canary --exact --yes --dist-tag=$BRANCH --preid=$BRANCH

But for me the version number is always 0 :(

AkselAllas avatar Sep 01 '22 07:09 AkselAllas

I wound up having to fetch more git history e.g. in github actions:

    steps:
      - uses: actions/checkout@v3
        with:
          token: ${{ secrets.REPO_MACHINE_ACCESS_TOKEN  }}
          fetch-depth: 0 

The version number comes from git describe, which counts the amount of commits from the last tag.

AkselAllas avatar Sep 01 '22 08:09 AkselAllas