Skip to content
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

chore: upgrade release workflow #3524

Merged
merged 5 commits into from
Feb 13, 2025
Merged

chore: upgrade release workflow #3524

merged 5 commits into from
Feb 13, 2025

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Feb 12, 2025

  • remove changelog check since we are trying to push the release changelog before creating the release branch
  • only put current changelog section in github release body
  • trigger typescript type publishing via workflow_call
  • upgrade softprops/action-gh-release

Example run: https://github.com/zeta-chain/ci-testing-node/actions/runs/13292302894
Example release: https://github.com/zeta-chain/ci-testing-node/releases/tag/v0.0.1739384888

Summary by CodeRabbit

  • Chores
    • Revamped the release workflow to improve version management, streamline release note generation, and enhance overall publishing reliability. These updates reduce manual intervention and accelerate the availability of new releases.
  • New Features
    • Introduced an automated process for publishing the TypeScript package, delivering updates with improved consistency and efficiency for quicker end-user access and ensuring rapid customer updates.

@gartnera gartnera added the no-changelog Skip changelog CI check label Feb 12, 2025
@gartnera gartnera requested a review from a team as a code owner February 12, 2025 18:39
Copy link
Contributor

coderabbitai bot commented Feb 12, 2025

📝 Walkthrough

Walkthrough

The changes update two GitHub Actions workflows. In the release publishing workflow, the changelog verification job has been removed, and version handling has been revised by replacing the major version variable with a generic version variable. The GitHub release action has been updated, and a new job for publishing TypeScript has been added. Separately, the TypeScript publishing workflow now uses a workflow call trigger, features updated action versions, and modifies the versioning and installation steps.

Changes

File(s) Change Summary
.github/workflows/publish-release.yml Removed the check-changelog job; replaced GITHUB_TAG_MAJOR_VERSION with GITHUB_TAG_VERSION; updated tag commands and release action from v1 to v2.2.0; changed release notes source to changelog-current.md; added new publish-typescript job.
.github/workflows/publish-typescript.yml Changed trigger from release to workflow_call; renamed job from build to publish; upgraded actions/checkout (v2→v4) with additional parameters, upgraded actions/setup-node (v2→v4); updated buf installation to version 1.47.2; modified versioning to use npm version from-git --no-git-tag-version.

Sequence Diagram(s)

sequenceDiagram
    participant Trigger as Event Trigger
    participant RelJob as Publish Release Job
    participant GitHub as GitHub Release API
    participant TSJob as Publish TypeScript Job

    Trigger->>RelJob: Initiate release process
    RelJob->>GitHub: Create release (using new version variable & action v2.2.0)
    Note over RelJob: Changelog verification removed
    RelJob->>TSJob: Trigger publish-typescript job (dependency)
Loading
sequenceDiagram
    participant Caller as Workflow Caller
    participant PubJob as Publish Job (TypeScript)
    participant Checkout as Checkout Action v4
    participant NodeSetup as Setup Node v4
    participant Buf as Buf Installer
    participant npm as NPM Registry

    Caller->>PubJob: Invoke via workflow_call
    PubJob->>Checkout: Checkout code (fetch-depth: 0, fetch-tags: true)
    PubJob->>NodeSetup: Configure Node environment
    PubJob->>Buf: Install buf v1.47.2
    PubJob->>PubJob: Set version using npm version from-git
    PubJob->>npm: Publish package on NPM
Loading

Possibly related PRs

Suggested labels

ci

Suggested reviewers

  • lumtis
  • morde08
  • CryptoFewka

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the ci Changes to CI pipeline or github actions label Feb 12, 2025
@gartnera gartnera requested a review from a team February 12, 2025 18:40
@gartnera gartnera enabled auto-merge February 12, 2025 18:40
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/publish-release.yml (1)

93-93: Remove trailing spaces.

Remove trailing spaces to fix the YAMLlint warning.

-            git push --tags      
+            git push --tags
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 93-93: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be5964c and cd1274a.

📒 Files selected for processing (2)
  • .github/workflows/publish-release.yml (2 hunks)
  • .github/workflows/publish-typescript.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/publish-release.yml

[error] 93-93: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: rpcimportable
  • GitHub Check: lint
  • GitHub Check: build-zetanode
  • GitHub Check: build-and-test
  • GitHub Check: gosec
  • GitHub Check: build
  • GitHub Check: Analyze (go)
🔇 Additional comments (10)
.github/workflows/publish-typescript.yml (4)

4-4: LGTM! Workflow reusability improvement.

The addition of the workflow_call trigger enables this workflow to be called from other workflows, improving modularity and reuse.


6-6: LGTM! Improved job naming.

The job name change from 'build' to 'publish' better reflects its primary purpose of publishing to NPM.


10-13: LGTM! Enhanced checkout configuration.

The upgrade to actions/checkout@v4 with fetch-depth: 0 and fetch-tags: true ensures proper version management by fetching the complete history and all tags.


33-33: LGTM! Improved version management.

Using npm version from-git is a more standard approach that ensures version consistency with git tags.

.github/workflows/publish-release.yml (6)

73-74: LGTM! Improved changelog extraction.

The new approach correctly extracts only the current changelog section for the release notes.


78-78: LGTM! Simplified version handling.

The version handling has been simplified by using a consistent GITHUB_TAG_VERSION variable throughout the workflow.

Also applies to: 83-83, 87-89, 92-92


108-108: LGTM! Consistent version variable usage.

The GORELEASER_CURRENT_TAG now uses the new GITHUB_TAG_VERSION variable, maintaining consistency.


123-127: LGTM! Improved attestation upload.

Using the GitHub CLI for uploading attestations is a more robust approach.


132-132: LGTM! Enhanced cleanup error handling.

Added error handling and debugging message to the cleanup step.


134-137: LGTM! Well-integrated TypeScript publishing.

The new TypeScript publishing job is well-integrated:

  • Correctly depends on publish-release completion
  • Uses the updated workflow via workflow_call
  • Properly inherits secrets

Copy link
Contributor

@CryptoFewka CryptoFewka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@gartnera gartnera added this pull request to the merge queue Feb 13, 2025
Merged via the queue into develop with commit 796e34a Feb 13, 2025
48 checks passed
@gartnera gartnera deleted the update-release-workflow branch February 13, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Changes to CI pipeline or github actions no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants