From 1fd10a34b61c45ca50b24c1a959b11f6a468688e Mon Sep 17 00:00:00 2001 From: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> Date: Wed, 7 Feb 2024 18:54:41 -0500 Subject: [PATCH] fix: create unique package versions for nightly releases --- .github/workflows/reusable-release.yml | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 7c99ffb10f..dbd1584235 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -289,6 +289,8 @@ jobs: run: | git config user.email "${{ github.actor }}@users.noreply.github.com" git config user.name ${{ github.actor }} + SHA_TAG=$(echo ${{ github.SHA }} | head -c 8) + echo "SHA_TAG=$SHA_TAG" >> $GITHUB_ENV - name: Install Dagger uses: dagger/dagger-for-github@v3 @@ -316,7 +318,7 @@ jobs: # First try to publish all the packages. Once a release or RC is made, all the package versions get bumped # and we want to publish nightly packages for the new versions. If this fails, presumably because some # packages have not changed since the last release, we'll try to publish only the packages that did change. - npm run publish:nightly -- --force-publish --yes + npm run publish:nightly -- --preid "nightly.${{ env.SHA_TAG }}" --force-publish --yes # If we reached here then the publish succeeded and we can exit the workflow exit 0 continue-on-error: true @@ -329,4 +331,4 @@ jobs: run: | npm config set //registry.npmjs.org/:_authToken $NODE_AUTH_TOKEN git reset --hard HEAD^ - npm run publish:nightly -- --yes || true + npm run publish:nightly -- --preid "nightly.${{ env.SHA_TAG }}" --yes || true diff --git a/package.json b/package.json index 5b2a2242bf..b8373afd06 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "publish:release-candidate-followup": "npx lerna publish --dist-tag next --preid rc --no-verify-access --conventional-prerelease", "publish:release": "npx lerna publish --dist-tag latest --create-release github --no-verify-access --conventional-graduate bump minor", "publish:hotfix": "npx lerna publish --dist-tag latest --no-verify-access --conventional-graduate bump patch", - "publish:nightly": "npx lerna publish --dist-tag nightly --no-verify-access --conventional-prerelease --preid nightly --no-push", + "publish:nightly": "npx lerna publish --dist-tag nightly --no-verify-access --conventional-prerelease --no-push", "format": "npx prettier --write 'packages/**/src/**/*{.ts,.tsx,.js}'", "lint": "npx lerna run lint && npx prettier --check packages/**/src/**/*.ts", "clean": "npm run clean:deps && npm run clean:coverage && npm run clean:build-artifacts",