From be5ceef1fb921315ae6bcf4ef602eeb38b88212c Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Fri, 4 Oct 2024 10:21:26 +0200 Subject: [PATCH] feat: Update CI to build branch named unstable releases, fixing duplicate versions when multiple feature branches exist simultaneously --- .../workflows/build-test-publish-on-push.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test-publish-on-push.yml b/.github/workflows/build-test-publish-on-push.yml index 44af5dab..bd9b0d64 100644 --- a/.github/workflows/build-test-publish-on-push.yml +++ b/.github/workflows/build-test-publish-on-push.yml @@ -81,18 +81,25 @@ jobs: - name: diff run: git diff + - name: Sets PREID + env: + name: "${{github.ref_name}}" + run: | + echo "PRE_ID=${name//[\/_-]/.}" >> $GITHUB_ENV + - name: publish @latest when on main if: github.ref == 'refs/heads/main' - run: pnpm publish:latest + run: lerna publish --conventional-commits --force-publish --include-merged-tags --sync-dist-version --create-release github --yes --dist-tag latest --registry https://registry.npmjs.org - name: publish @next when on develop if: github.ref == 'refs/heads/develop' - run: pnpm publish:next + run: lerna publish --conventional-prerelease --force-publish --canary --sync-dist-version --no-git-tag-version --include-merged-tags --preid next --pre-dist-tag next --yes --registry https://registry.npmjs.org", - - name: publish @next when on fix + - name: publish @next when on fix branch if: startsWith(github.ref, 'refs/heads/fix') - run: pnpm publish:next + run: lerna publish --conventional-prerelease --force-publish --canary --sync-dist-version --no-git-tag-version --include-merged-tags --preid fix --pre-dist-tag fix --yes --registry https://registry.npmjs.org", - name: publish @unstable when on unstable branch if: startsWith(github.ref, 'refs/heads/feat') - run: pnpm publish:unstable + run: lerna publish --conventional-prerelease --force-publish --canary --sync-dist-version --no-git-tag-version --include-merged-tags --preid $PRE_ID --pre-dist-tag unstable --yes --throttle-size 75 --registry https://registry.npmjs.org +