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

Change desktop publishing options to upload artifacts #423

Conversation

devleejb
Copy link
Member

@devleejb devleejb commented Dec 8, 2024

What this PR does / why we need it:

As the electron-builder only detects releases which the release type is draft, the github actions don't upload artifacts. So this PR changes the detection draft type to release and deletes redundant uploading actions.

Which issue(s) this PR fixes:

Fixes #422

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • New Features

    • Added a releaseType property to enhance build configurations.
    • Updated product name to "CodePair" for improved identification.
  • Bug Fixes

    • Removed the "Upload Release Assets" step to streamline the release workflow.
  • Chores

    • Updated environment variable from GITHUB_TOKEN to GH_TOKEN in the build process.

Copy link
Contributor

coderabbitai bot commented Dec 8, 2024

Walkthrough

The pull request modifies the GitHub Actions workflow for the desktop-release, maintaining the trigger on published releases while updating the job configuration. Key changes include renaming the environment variable GITHUB_TOKEN to GH_TOKEN and removing the "Upload Release Assets" step. Additionally, the package.json file for the @codepair/desktop project has been updated to include a new releaseType property and change the productName casing from "codepair" to "CodePair".

Changes

File Path Change Summary
.github/workflows/desktop-publish.yml - Renamed environment variable from GITHUB_TOKEN to GH_TOKEN.
- Removed "Upload Release Assets" step.
desktop/package.json - Added releaseType: "release" in build.publish.
- Updated productName from "codepair" to "CodePair".

Assessment against linked issues

Objective Addressed Explanation
GitHub Actions should upload required artifacts (422) The "Upload Release Assets" step has been removed.

Possibly related PRs

Poem

In the land of code where rabbits hop,
The workflows dance, and never stop.
With tokens renamed and steps set free,
Our releases shine, as bright as can be!
CodePair's name now stands so tall,
A joyful leap, we celebrate it all! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 061dc3e and 188a271.

📒 Files selected for processing (2)
  • .github/workflows/desktop-publish.yml (1 hunks)
  • desktop/package.json (1 hunks)
🔇 Additional comments (4)
.github/workflows/desktop-publish.yml (1)

35-35: LGTM! Environment variable change aligns with electron-builder requirements

The change from GITHUB_TOKEN to GH_TOKEN is correct and follows electron-builder's expected configuration. This change, combined with the removal of redundant upload steps, should resolve the artifact upload issues.

Let's verify this is a common pattern with electron-builder:

✅ Verification successful

Let me gather more information about electron-builder's GH_TOKEN usage pattern.


Let me try a different approach to find electron-builder configuration.


Let me search for electron-builder configuration files to verify the GH_TOKEN usage pattern.


Based on the findings, I can now generate the final response:

Verified! The GH_TOKEN environment variable is the correct configuration for electron-builder

The change is correct as evidenced by:

  • The project uses electron-builder v25.1.8 which expects GH_TOKEN for GitHub releases
  • The package.json configuration shows GitHub as the publish provider
  • The release script uses electron-builder's --publish always flag which requires GitHub authentication
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar GH_TOKEN usage in electron-builder workflows
rg -l "GH_TOKEN.*secrets.GITHUB_TOKEN" .github/

Length of output: 87


Script:

#!/bin/bash
# Search for electron-builder configuration and documentation references
fd -e json -e js "electron-builder" --exec cat {}

Length of output: 51


Script:

#!/bin/bash
# Look for package.json files that might contain electron-builder config
fd "package.json" --exec cat {} | grep -A 10 -B 10 "electron-builder"

# Also search for any yml/yaml files that might contain electron-builder config
fd -e yml -e yaml . --exec cat {}

Length of output: 72743


Script:

#!/bin/bash
# Search for electron-builder config in package.json and other config files
rg -A 5 -B 5 '"build":\s*{' package.json
rg -A 5 -B 5 "electron-builder" .

Length of output: 7578

desktop/package.json (3)

31-32: LGTM! Release type configuration addresses the core issue

The addition of "releaseType": "release" directly fixes the electron-builder artifact upload issue by explicitly configuring it to work with releases rather than drafts.


31-32: Verify complete electron-builder publish configuration

The publish configuration looks correct with GitHub provider and release type. Let's verify this matches electron-builder's recommended setup.

Check for any missing recommended publish configuration:

✅ Verification successful

Publish configuration is correctly set up

The electron-builder configuration in package.json is complete and follows the recommended setup:

  • GitHub provider is correctly specified for publishing
  • Release type is set to "release" for stable releases
  • All necessary build configurations are present including:
    • Valid appId and productName
    • Proper file inclusions/exclusions
    • Platform-specific build targets (mac, windows, linux)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar electron-builder publish configurations
rg -A 5 '"publish":\s*{' --type json

# Check package.json for any other electron-builder specific configurations
rg '"electron-builder"' package.json

Length of output: 169


Script:

#!/bin/bash
# Search for similar electron-builder publish configurations with fixed regex
rg -A 5 '"publish": \{' --type json

# Search for electron-builder config in package.json
cat desktop/package.json | jq '.["build"]'

Length of output: 975


35-35: Verify impact of product name change

While the casing change from "codepair" to "CodePair" improves branding consistency, we should verify this won't cause issues with existing installations.

Let's check for any hardcoded references to the old name:

✅ Verification successful

Product name change from "codepair" to "CodePair" appears safe

The casing change in productName from "codepair" to "CodePair" in desktop/package.json is safe because:

  • The appId "com.yorkie-team.codepair" remains lowercase which is the important identifier for installations
  • The codebase consistently uses "CodePair" in visible UI elements (titles, descriptions, etc.)
  • File system references use lowercase "codepair" in package names and URLs
  • No hardcoded paths or references were found that would break due to this casing change
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for potential hardcoded references to the old product name
rg -i "productName.*codepair" --type yaml --type typescript --type javascript
rg -i "com\.yorkie-team\.codepair" --type yaml --type typescript --type javascript

Length of output: 234


Script:

#!/bin/bash
# Search for potential hardcoded references to the old product name using ripgrep
# without file type restrictions to catch all occurrences
rg -i "codepair" 

# Also specifically check package.json files
fd "package.json" --exec grep -i "codepair" {}

Length of output: 32249


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.

@devleejb devleejb merged commit 1ba7ac8 into main Dec 8, 2024
1 check passed
@devleejb devleejb deleted the 422-github-actions-not-uploading-artifacts-for-electron-application-release branch December 8, 2024 07:26
@coderabbitai coderabbitai bot mentioned this pull request Dec 15, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

GitHub Actions not uploading artifacts for Electron application release
1 participant