-
Notifications
You must be signed in to change notification settings - Fork 88
ci(release): fix Changesets reset by using head_sha and naga tip #941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,7 +25,6 @@ jobs: | |||||||
| if: >- | ||||||||
| ${{ github.event.workflow_run.conclusion == 'success' && | ||||||||
| github.event.workflow_run.event == 'push' && | ||||||||
| github.repository == 'LIT-Protocol/js-sdk' && | ||||||||
| (github.event.workflow_run.head_branch == 'naga' || | ||||||||
| github.event.workflow_run.head_branch == 'canary-naga') }} | ||||||||
| # Enable this when we want to implement docker image release | ||||||||
|
|
@@ -46,7 +45,7 @@ jobs: | |||||||
| uses: actions/checkout@v4 | ||||||||
| with: | ||||||||
| fetch-depth: 0 | ||||||||
| ref: ${{ github.event.workflow_run.head_branch }} | ||||||||
| ref: ${{ github.event.workflow_run.head_sha }} | ||||||||
|
|
||||||||
| - name: Setup PNPM | ||||||||
| uses: pnpm/action-setup@v4 | ||||||||
|
|
@@ -73,18 +72,6 @@ jobs: | |||||||
| cache: 'pnpm' | ||||||||
| cache-dependency-path: pnpm-lock.yaml | ||||||||
|
|
||||||||
| - name: Print repo and branch context | ||||||||
| run: | | ||||||||
| echo "Repo: $GITHUB_REPOSITORY" | ||||||||
| echo "Head branch: ${{ github.event.workflow_run.head_branch }}" | ||||||||
| echo "Workflow head_sha: ${{ github.event.workflow_run.head_sha }}" | ||||||||
| echo "Checked out ref: $(git rev-parse --abbrev-ref HEAD)" | ||||||||
| echo "Current commit: $(git rev-parse HEAD)" | ||||||||
| echo "Node: $(node -v)" | ||||||||
| echo "PNPM: $(pnpm --version)" | ||||||||
| [ -f pnpm-lock.yaml ] && echo "pnpm-lock.yaml present" || echo "pnpm-lock.yaml missing" | ||||||||
| [ -d .changeset ] && echo ".changeset present" || echo ".changeset missing" | ||||||||
|
|
||||||||
| - name: Install project dependencies | ||||||||
| run: pnpm install --frozen-lockfile | ||||||||
|
|
||||||||
|
|
@@ -100,6 +87,26 @@ jobs: | |||||||
| - name: Build packages | ||||||||
| run: pnpm run build | ||||||||
|
|
||||||||
| - name: Preflight diagnostics | ||||||||
| run: | | ||||||||
| echo "Repo: $GITHUB_REPOSITORY" | ||||||||
| echo "Head branch: ${{ github.event.workflow_run.head_branch }}" | ||||||||
| echo "Workflow head_sha: ${{ github.event.workflow_run.head_sha }}" | ||||||||
| echo "Checked out ref: $(git rev-parse --abbrev-ref HEAD)" | ||||||||
| echo "Current commit: $(git rev-parse HEAD)" | ||||||||
| echo "Node: $(node -v)" | ||||||||
| echo "PNPM: $(pnpm --version)" | ||||||||
| [ -f pnpm-lock.yaml ] && echo "pnpm-lock.yaml present" || echo "pnpm-lock.yaml missing" | ||||||||
| if [ -d .changeset ]; then | ||||||||
| echo ".changeset present" && ls -la .changeset | ||||||||
| if [ -f .changeset/config.json ]; then | ||||||||
| echo "changeset config (baseBranch + mode if pre):" | ||||||||
| jq '{ baseBranch: .baseBranch, pre: .pre }' .changeset/config.json || cat .changeset/config.json | ||||||||
| fi | ||||||||
| else | ||||||||
| echo ".changeset missing" | ||||||||
| fi | ||||||||
|
|
||||||||
| - name: Compute branch tip SHA | ||||||||
| id: branch_tip | ||||||||
| run: | | ||||||||
|
|
@@ -109,6 +116,11 @@ jobs: | |||||||
| echo "Resolved branch tip SHA: $TIP_SHA" | ||||||||
| echo "sha=$TIP_SHA" >> "$GITHUB_OUTPUT" | ||||||||
|
|
||||||||
| - name: Reset release branch base | ||||||||
| run: | | ||||||||
| git fetch --no-tags --prune origin | ||||||||
| git push origin :changeset-release/${{ github.event.workflow_run.head_branch }} || true | ||||||||
|
|
||||||||
| - name: Create Release Pull Request or Publish to npm | ||||||||
| id: changesets | ||||||||
| uses: changesets/action@v1 | ||||||||
|
|
@@ -118,11 +130,30 @@ jobs: | |||||||
| publish: pnpm changeset publish --access public | ||||||||
| commit: 'chore(release): version packages' | ||||||||
| title: 'chore(release): version packages' | ||||||||
|
||||||||
| title: 'chore(release): version packages' | |
| title: 'chore(release): version packages' | |
| # Use commitMode: github to avoid Changesets reset issue (see PR title for context). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The step name 'Reset release branch base' is misleading as the step actually deletes a remote changeset release branch. Consider renaming to 'Clean up existing changeset release branch' or 'Delete previous changeset release branch' for clarity.