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 jq entry on Step 13 of Codemagic CLI procedure on 'Build and release a macOS app' #7523

Closed
mmattes opened this issue Sep 6, 2022 · 2 comments
Labels
dev.deployment Relates to deploying Flutter app section of Flutter.dev e0-minutes Effort: < 60 min p2-medium Necessary but not urgent concern. Resolve when possible. target.macOS Target apps on the macOS platform

Comments

@mmattes
Copy link

mmattes commented Sep 6, 2022

Page URL

https://docs.flutter.dev/deployment/macos/

Page source

https://github.com/flutter/website/tree/main/src/deployment/macos.md

Describe the problem

In Create a build archive with Codemagic CLI tools Point 13. Package the App the following code snipped is mentioned. My keychain for some reason contained multiple certs with the common name containing "Mac Developer Installer" so it found multiple common names which it simply concatenated into the variable INSTALLER_CERT_NAME

APP_NAME=$(find $(pwd) -name "*.app")
PACKAGE_NAME=$(basename "$APP_NAME" .app).pkg
xcrun productbuild --component "$APP_NAME" /Applications/ unsigned.pkg

INSTALLER_CERT_NAME=$(keychain list-certificates \
          | jq '.[]
            | select(.common_name
            | contains("Mac Developer Installer"))
            | .common_name' \
          | xargs)
xcrun productsign --sign "$INSTALLER_CERT_NAME" unsigned.pkg "$PACKAGE_NAME"
rm -f unsigned.pkg 

Expected fix

Changing it to jq '[.[]...][0] will only retrun the first common name of the cert which contains "Mac Developer Installer" in its common name.

APP_NAME=$(find $(pwd) -name "*.app")
PACKAGE_NAME=$(basename "$APP_NAME" .app).pkg
xcrun productbuild --component "$APP_NAME" /Applications/ unsigned.pkg

INSTALLER_CERT_NAME=$(keychain list-certificates \
          | jq '[.[]
            | select(.common_name
            | contains("Mac Developer Installer"))
            | .common_name][0]' \
          | xargs)
xcrun productsign --sign "$INSTALLER_CERT_NAME" unsigned.pkg "$PACKAGE_NAME"
rm -f unsigned.pkg 

Additional context

No response

@danagbemava-nc danagbemava-nc added st.triage.triage-team Triage team reviewing and categorizing the issue p2-medium Necessary but not urgent concern. Resolve when possible. e0-minutes Effort: < 60 min and removed st.triage.triage-team Triage team reviewing and categorizing the issue labels Sep 7, 2022
@Hirdey-1999
Copy link
Contributor

Made The Changes To MacOS.md File Please Check If Found Any Decrepancy
#7529

@atsansone atsansone added the target.macOS Target apps on the macOS platform label May 17, 2023
@atsansone atsansone changed the title [PAGE ISSUE]: 'Build and release a macOS app' Fix jq entry on Step 13 of Codemagic CLI procedure on 'Build and release a macOS app' May 17, 2023
@atsansone atsansone added the dev.deployment Relates to deploying Flutter app section of Flutter.dev label May 17, 2023
@atsansone
Copy link
Contributor

Fixed in #7529. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev.deployment Relates to deploying Flutter app section of Flutter.dev e0-minutes Effort: < 60 min p2-medium Necessary but not urgent concern. Resolve when possible. target.macOS Target apps on the macOS platform
Projects
None yet
Development

No branches or pull requests

4 participants