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

use upload-artifact v4 #4332

Merged
merged 1 commit into from
Dec 9, 2024
Merged

use upload-artifact v4 #4332

merged 1 commit into from
Dec 9, 2024

Conversation

jackzhhuang
Copy link
Collaborator

@jackzhhuang jackzhhuang commented Dec 9, 2024

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

Summary by CodeRabbit

  • Chores
    • Updated the GitHub Actions workflow for building and uploading release assets.
    • Upgraded the artifact upload action from version v2 to v4 for improved performance and reliability.

Copy link

coderabbitai bot commented Dec 9, 2024

Walkthrough

The changes in the .github/workflows/release_asset.yml file involve updates to the GitHub Actions workflow for building and uploading release assets. The workflow is now triggered by manual dispatch and upon release publication. Key updates include upgrading the actions/upload-artifact action from version v2 to v4 in both the build-on-github and build-on-selfhosted jobs. Additionally, conditional steps for uploading artifacts have been implemented based on the event type, ensuring that the correct upload action is used depending on whether the event is a release or not.

Changes

File Change Summary
.github/workflows/release_asset.yml Updated actions/upload-artifact from v2 to v4 in both build-on-github and build-on-selfhosted jobs. Added conditional steps for artifact uploads based on event type.

Poem

In a world of code, so bright and new,
The rabbit hops with a joyful view.
With actions updated, we build and share,
Artifacts flying through the digital air!
A release is coming, let the fun begin,
With every upload, we all win! 🐇✨


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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@jackzhhuang jackzhhuang requested a review from sanlee42 December 9, 2024 07:28
Copy link

@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: 1

🧹 Outside diff range and nitpick comments (1)
.github/workflows/release_asset.yml (1)

Line range hint 1-150: Consider using reusable workflows to reduce duplication

The workflow contains similar upload patterns in both jobs. Consider:

  1. Creating a reusable workflow for the upload logic
  2. Parameterizing the platform-specific parts
  3. Using composite actions for repeated steps

This would reduce maintenance overhead and make future version upgrades easier to manage.

Example structure:

# .github/workflows/upload-asset.yml
name: Upload Asset
on:
  workflow_call:
    inputs:
      platform:
        required: true
        type: string
      artifact-name:
        required: true
        type: string

jobs:
  upload:
    runs-on: ${{ inputs.platform }}
    steps:
      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        if: ${{ github.event_name != 'release' }}
        with:
          name: ${{ inputs.artifact-name }}
          path: ${{ inputs.artifact-name }}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8a020f9 and 15982f9.

📒 Files selected for processing (1)
  • .github/workflows/release_asset.yml (2 hunks)
🔇 Additional comments (1)
.github/workflows/release_asset.yml (1)

116-116: Verify Node.js compatibility on self-hosted runner

The upgrade to upload-artifact@v4 requires Node16 as a minimum runtime. Please ensure your self-hosted runner meets this requirement.

@@ -57,7 +57,7 @@ jobs:
run: bash ./scripts/release_mpm.sh ${{ matrix.platform }}

- name: upload artifact asset
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Upgrade related actions for consistency and security

The verification confirms that both related actions have newer versions available:

  • actions/checkout is at v4.2.2 (current: v2)
  • actions/upload-release-asset has been deprecated in favor of @softprops/action-gh-release

Consider:

  • Upgrading actions/checkout@v2 to v4
  • Replacing actions/upload-release-asset@v1 with @softprops/action-gh-release
🔗 Analysis chain

Consider upgrading related actions for consistency

While upgrading to upload-artifact@v4 is good, other actions in the workflow are using older versions. Consider:

  • Upgrading actions/checkout@v2 to v4
  • Upgrading actions/upload-release-asset@v1 to the latest version
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check the latest versions of the GitHub Actions being used
gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/actions/checkout/releases/latest

gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/actions/upload-release-asset/releases/latest

Length of output: 4666

@jackzhhuang jackzhhuang enabled auto-merge (squash) December 9, 2024 07:37
@jackzhhuang jackzhhuang merged commit d69e48b into dag-master Dec 9, 2024
3 of 5 checks passed
@jackzhhuang jackzhhuang deleted the release-asset-4 branch December 9, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants