4d / build4d-action

MIT License
0 stars 0 forks source link

Allow to sign builded code #7

Open e-marchand opened 4 months ago

e-marchand commented 3 weeks ago

https://docs.github.com/en/actions/use-cases-and-examples/deploying/installing-an-apple-certificate-on-macos-runners-for-xcode-development

Avec

et des chemins de travail

CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

before

import certificate from secrets

echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH

create temporary keychain

security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

import certificate to keychain

security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH

sign

???

via l'ajout de --keychain "path/to/keychain" voir si cela match bien avec --sign "identity"

or maybe previous command security list-keychain allow keychain to be available

after

remove

security delete-keychain $RUNNER_TEMP/app-signing.keychain-db`

and remove files

e-marchand commented 3 weeks ago

code 4D pour essayer de le faire dans cette branche à tester https://github.com/4d/build4d-action/tree/feature/signwithp12

si ca marche, reste à rajouter dans le yaml un ensemble de clef

optionnellement (sinon c'est généré)