Created
January 5, 2023 19:22
-
-
Save praeclarum/faaf70a24c0a3b317e8ef4d92887c2fc to your computer and use it in GitHub Desktop.
GitHub Actions to build a Mac AppStore app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Import Apple Certificate | |
uses: apple-actions/import-codesign-certs@v1 | |
with: | |
create-keychain: true | |
keychain-password: ${{ secrets.APPSTORE_CERTIFICATE_P12_PASSWORD }} | |
p12-file-base64: ${{ secrets.APPSTORE_CERTIFICATE_P12 }} | |
p12-password: ${{ secrets.APPSTORE_CERTIFICATE_P12_PASSWORD }} | |
- name: Import Mac Installer Certificate | |
uses: apple-actions/import-codesign-certs@v1 | |
with: | |
create-keychain: false | |
keychain-password: ${{ secrets.APPSTORE_CERTIFICATE_P12_PASSWORD }} | |
p12-file-base64: ${{ secrets.APPSTORE_INSTALLER_CERTIFICATE_P12 }} | |
p12-password: ${{ secrets.APPSTORE_INSTALLER_CERTIFICATE_P12_PASSWORD }} | |
- name: Download Mac Provisioning Profile | |
uses: apple-actions/download-provisioning-profiles@v1 | |
with: | |
bundle-id: 'com.kruegersystems.circuitmac' | |
profile-type: 'MAC_APP_STORE' | |
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} | |
api-key-id: ${{ secrets.APPSTORE_KEY_ID }} | |
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }} | |
- name: Fix Provisioning Profile Extension | |
shell: bash | |
run: | | |
for f in $HOME/Library/MobileDevice/Provisioning\ Profiles/*.mobileprovision; do | |
mv -- "$f" "${f%.mobileprovision}.provisionprofile" | |
done | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Update Version | |
if: ${{ true || (needs.check_deploy.outputs.should_deploy != 'false') }} | |
run: bash version.sh ${{github.run_number}} | |
- name: Restore Mac | |
run: | | |
msbuild /t:Restore /p:Configuration=Release iCircuit.Mac.sln | |
- name: Fix Mac Entitlements | |
run: | | |
/usr/libexec/PlistBuddy -x -c "Set com.apple.developer.icloud-container-environment Production" CircuitMac/Entitlements.plist | |
- name: Build Mac | |
id: build_mac | |
run: | | |
msbuild /t:Build /p:Configuration=Release /p:ArchiveOnBuild=true /p:CreatePackage=true /p:EnablePackageSigning=true /p:EnableCodeSigning=true "/p:CodeSigningKey=3rd Party Mac Developer Application" "/p:CodeSignProvision=iCircuit Mac Distribution" "/p:PackageSigningKey=3rd Party Mac Developer Installer" iCircuit.Mac.sln | |
ls -al CircuitMac/bin/Release/iCircuit-*.pkg | |
echo "::set-output name=mac_pkg_rel_path::$(ls CircuitMac/bin/Release/iCircuit-*.pkg)" | |
- run: echo ${{ steps.build_mac.outputs.mac_pkg_rel_path }} | |
- name: Upload Mac to TestFlight | |
if: ${{ needs.check_deploy.outputs.should_deploy != 'false' }} | |
uses: apple-actions/upload-testflight-build@v1 | |
with: | |
app-type: macos | |
app-path: ${{ steps.build_mac.outputs.mac_pkg_rel_path }} | |
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} | |
api-key-id: ${{ secrets.APPSTORE_KEY_ID }} | |
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment