From 30648c469d9b0f9b2f3195514ba08e39f07b3a67 Mon Sep 17 00:00:00 2001 From: Himanshu Garg Date: Wed, 27 Aug 2025 17:31:10 +0530 Subject: [PATCH 1/3] fix(workflows): conditionally publish packages for nightly releases --- .github/workflows/release-packages.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index cec8f564e6f..e07ac1aedf8 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -99,12 +99,15 @@ jobs: run: pnpm run build:packages - name: Publish packages (nightly only) - if: ${{ github.event.inputs.nightly }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | - export NX_RELEASE_TAG=nightly - pnpm nx run-many -t nx-release-publish --projects=${{ github.event.inputs.packages }} + if [ "${{ github.event.inputs.nightly }}" = "true" ]; then + export NX_RELEASE_TAG=nightly + pnpm nx run-many -t nx-release-publish --projects=${{ github.event.inputs.packages }} + else + echo "Skipping publish for non-nightly release" + fi - name: Create Pull Request id: create-pr From 28ad9041afce53eafece1c0269588d33eb29b7fe Mon Sep 17 00:00:00 2001 From: Himanshu Garg Date: Wed, 27 Aug 2025 17:42:25 +0530 Subject: [PATCH 2/3] feat(workflows): add debugging and reset steps for non-nightly releases --- .github/workflows/release-packages.yml | 29 +++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index e07ac1aedf8..19ae65c95da 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -109,6 +109,32 @@ jobs: echo "Skipping publish for non-nightly release" fi + - name: Debug git status + if: ${{ !github.event.inputs.nightly }} + run: | + echo "=== Git Status ===" + git status + echo "=== Git Log (last 3 commits) ===" + git log --oneline -3 + echo "=== Changed Files ===" + git diff --name-only HEAD~1 || echo "No commits to compare against" + + - name: Reset to clean state for PR creation + if: ${{ !github.event.inputs.nightly }} + run: | + echo "=== Resetting any commits made by NX ===" + # If NX created commits, reset to the original commit but keep changes + if [ "$(git log --oneline HEAD~1..HEAD | wc -l)" -gt "0" ]; then + echo "Found $(git log --oneline HEAD~1..HEAD | wc -l) commits since start" + git reset --soft HEAD~$(git log --oneline HEAD~1..HEAD | wc -l) + echo "Reset commits, changes are now staged" + git status + else + echo "No commits to reset" + # Stage any unstaged changes + git add -A + fi + - name: Create Pull Request id: create-pr if: ${{ !github.event.inputs.nightly }} @@ -130,11 +156,12 @@ jobs: ### 🔄 Changes: - Updated package versions to ${{ github.event.inputs.version }} - Generated changelogs from ${{ github.event.inputs.previous_tag }} - - Built and published packages to NPM + - Built packages for release **Please review the changes and merge when ready for the release to be tagged and GitHub releases to be created.** branch: release-${{ github.event.inputs.version }} base: next + delete-branch: false post_release: needs: release From c8365b5fe310c000d7af4cbe60e6296a152289e6 Mon Sep 17 00:00:00 2001 From: Himanshu Garg Date: Wed, 27 Aug 2025 17:47:32 +0530 Subject: [PATCH 3/3] refactor(workflows): remove nightly conditionals from debug and reset steps --- .github/workflows/release-packages.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 19ae65c95da..a7ef043cf4a 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -110,7 +110,6 @@ jobs: fi - name: Debug git status - if: ${{ !github.event.inputs.nightly }} run: | echo "=== Git Status ===" git status @@ -120,7 +119,6 @@ jobs: git diff --name-only HEAD~1 || echo "No commits to compare against" - name: Reset to clean state for PR creation - if: ${{ !github.event.inputs.nightly }} run: | echo "=== Resetting any commits made by NX ===" # If NX created commits, reset to the original commit but keep changes @@ -137,7 +135,6 @@ jobs: - name: Create Pull Request id: create-pr - if: ${{ !github.event.inputs.nightly }} uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }}