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

fix: Update release builds with the new notarytool tool #976

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

kolipakakondal
Copy link
Collaborator

@kolipakakondal kolipakakondal commented Jun 5, 2024

Description

Please include a summary of the change and which issue is fixed.

Fixes # (IEP-XXX)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • ESP-IDF Version:
  • OS (Windows,Linux and macOS):

Dependent components impacted by this PR:

  • Component 1
  • Component 2

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

Summary by CodeRabbit

  • Chores
    • Improved the notarization process for Espressif-IDE dmg files, ensuring better security and compliance.
    • Added new environment variable NOTARIZATION_TEAM_ID for enhanced notarization setup.
    • Renamed the notarization job for clarity.

Copy link

coderabbitai bot commented Jun 5, 2024

Walkthrough

The changes in the .github/workflows/ci_release.yml file enhance the notarization process for Espressif-IDE dmg files by adding steps to create and manage a notary keychain, setting up keychain profiles, and automating the notarization and stapling of dmg files. This streamlines the process and ensures that both x86_64 and aarch64 dmg files are properly notarized and secured.

Changes

File Change Summary
.github/workflows/ci_release.yml Updated notarization job name, added NOTARIZATION_TEAM_ID, and enhanced the script for notarization including keychain management and notarization steps.

Poem

In the realm of code, where bytes take flight,
Espressif-IDE shines so bright.
With keychains set and profiles in tow,
Notarization's now a seamless flow.
Dmg files, both large and small,
Securely stamped, we stand tall.
🎉🐰✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between be9255f and ac821b3.

Files selected for processing (1)
  • .github/workflows/ci_release.yml (2 hunks)
Additional comments not posted (1)
.github/workflows/ci_release.yml (1)

66-90: Ensure the new notarization process is thoroughly tested across all platforms.

Verification successful

The notarization and stapling commands for both x86_64 and aarch64 dmg files are present in the GitHub Actions workflow file. This indicates that the notarization process is correctly implemented in the workflow.

  • xcrun notarytool submit commands for both x86_64 and aarch64 dmg files are found.
  • xcrun stapler staple commands for both x86_64 and aarch64 dmg files are found.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the notarization process on all platforms.

# Test: Check logs for successful notarization and stapling on macOS x86_64 and aarch64.
# Expect: Logs should show successful notarization and no errors related to the notarytool.
rg --type yaml "notarization complete" .github/workflows/ci_release.yml

Length of output: 73



Script:

#!/bin/bash
# Description: Verify the notarization process in the GitHub Actions workflow file.

# Test: Check for the presence of notarization and stapling commands in the workflow file.
# Expect: The file should contain commands for notarization and stapling for both x86_64 and aarch64 dmg files.

# Search for notarization commands
rg --type yaml "xcrun notarytool submit" .github/workflows/ci_release.yml

# Search for stapling commands
rg --type yaml "xcrun stapler staple" .github/workflows/ci_release.yml

Length of output: 646

Comment on lines +66 to +90
- name: Notarization of Espressif-IDE dmg files
env:
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
run: |
echo "Notarization of Espressif-IDE-macosx-cocoa-x86_64.dmg"
xcrun altool --notarize-app -f $PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64.dmg -u $NOTARIZATION_USERNAME -p $NOTARIZATION_PASSWORD --primary-bundle-id Espressif-ide.app

- name: Notarize Espressif-IDE-macosx-cocoa-aarch64.dmg
env:
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
run: |
echo "Notarization of Espressif-IDE-macosx-cocoa-aarch64.dmg"
xcrun altool --notarize-app -f $PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64.dmg -u $NOTARIZATION_USERNAME -p $NOTARIZATION_PASSWORD --primary-bundle-id Espressif-ide.app

NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
NOTARIZATION_TEAM_ID: ${{ secrets.NOTARIZATION_TEAM_ID }}
run: |
echo "Create notary keychain"
/usr/bin/security create-keychain -p espressif notary.keychain
/usr/bin/security default-keychain -s notary.keychain
/usr/bin/security unlock-keychain -p espressif notary.keychain

echo "Create keychain profile"
xcrun notarytool store-credentials "ide-notarytool-profile" --apple-id $NOTARIZATION_USERNAME --team-id $NOTARIZATION_TEAM_ID --password $NOTARIZATION_PASSWORD
xcrun notarytool submit $PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64.dmg --keychain-profile "ide-notarytool-profile" --wait

echo "Attach staple for x86_64.dmg"
xcrun stapler staple $PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-x86_64.dmg

echo "Unlock the notary keychain"
/usr/bin/security unlock-keychain -p espressif notary.keychain

xcrun notarytool submit $PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64.dmg --keychain-profile "ide-notarytool-profile" --wait
echo "Attach staple for aarch64.dmg"
xcrun stapler staple $PWD/releng/ide-dmg-builder/Espressif-IDE-macosx-cocoa-aarch64.dmg

Copy link

Choose a reason for hiding this comment

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

The updated notarization steps appear comprehensive. Consider adding detailed logging for each step to enhance traceability and error handling.

+ echo "Starting notarization for x86_64..."
+ echo "Starting notarization for aarch64..."

Committable suggestion was skipped due to low confidence.

@kolipakakondal kolipakakondal merged commit 84e3b18 into master Jun 5, 2024
7 checks passed
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.

1 participant