Section 11/171 menit

11. Post-Actions: Notifikasi dan Distribusi

11. Post-Actions: Notifikasi dan Distribusi

Notify Action

Kirim notifikasi ke Slack atau email setelah build:

swift
Post-Action: Notify
├── When: Always / On Failure / On Success / On Success After Failure
├── Destinations:
│   ├── Slack — webhook URL (tambahkan sebagai secret environment variable)
│   └── Email — alamat email tim atau alias
└── Message: Opsional custom message

Untuk Slack webhook yang lebih kaya, gunakan ci_post_xcodebuild.sh:

swift
#!/bin/zsh
# ci_scripts/ci_post_xcodebuild.sh

# Kirim custom Slack notification setelah archive
if [[ "$CI_XCODEBUILD_ACTION" == "archive" && -n "$SLACK_WEBHOOK_URL" ]]; then
    
    STATUS_EMOJI="✅"
    STATUS_TEXT="Build sukses"
    
    # Deteksi status build (exit code dari xcodebuild sudah passed jika sampai sini)
    
    PAYLOAD=$(cat << EOF
{
    "blocks": [
        {
            "type": "header",
            "text": {
                "type": "plain_text",
                "text": "${STATUS_EMOJI} iOS Build — ${CI_PRODUCT}"
            }
        },
        {
            "type": "section",
            "fields": [
                {"type": "mrkdwn", "text": "*Branch:*\n${CI_BRANCH}"},
                {"type": "mrkdwn", "text": "*Build:*\n#${CI_BUILD_NUMBER}"},
                {"type": "mrkdwn", "text": "*Commit:*\n${CI_COMMIT:0:8}"},
                {"type": "mrkdwn", "text": "*Status:*\n${STATUS_TEXT}"}
            ]
        }
    ]
}
EOF
)
    
    curl -s -X POST \
        -H 'Content-type: application/json' \
        --data "$PAYLOAD" \
        "$SLACK_WEBHOOK_URL"
fi

TestFlight Distribution

swift
Post-Action: TestFlight Internal Testing
├── Internal Groups: [pilih grup tester internal di App Store Connect]
└── Triggers automatically after successful Archive action

Post-Action: TestFlight External Testing
├── External Groups: [pilih grup beta tester eksternal]
└── Requires App Store Review untuk build pertama setiap versi baru