Skip to content

Instantly share code, notes, and snippets.

@praeclarum
Created January 5, 2023 19:22
Show Gist options
  • Select an option

  • Save praeclarum/faaf70a24c0a3b317e8ef4d92887c2fc to your computer and use it in GitHub Desktop.

Select an option

Save praeclarum/faaf70a24c0a3b317e8ef4d92887c2fc to your computer and use it in GitHub Desktop.

Revisions

  1. praeclarum created this gist Jan 5, 2023.
    62 changes: 62 additions & 0 deletions mactestflight.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    - 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 }}