Skip to content

Commit 9126304

Browse files
authored
Merge pull request #110 from urbanairship/MOBILE-5353
Plugin automation
2 parents 6cc0911 + ddbcaad commit 9126304

File tree

8 files changed

+1559
-174
lines changed

8 files changed

+1559
-174
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Prepare Plugin Releases
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
proxy_version:
7+
description: 'New Framework Proxy Version (x.y.z)'
8+
required: true
9+
ios_version:
10+
description: 'iOS SDK Version (x.y.z - optional)'
11+
required: false
12+
android_version:
13+
description: 'Android SDK Version (x.y.z - optional)'
14+
required: false
15+
test_mode:
16+
description: 'Test mode (adds -test suffix to branches)'
17+
type: boolean
18+
default: false
19+
react_native:
20+
description: 'Update React Native'
21+
type: boolean
22+
default: true
23+
cordova:
24+
description: 'Update Cordova'
25+
type: boolean
26+
default: true
27+
flutter:
28+
description: 'Update Flutter'
29+
type: boolean
30+
default: true
31+
capacitor:
32+
description: 'Update Capacitor'
33+
type: boolean
34+
default: true
35+
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.MOBILE_PLUGIN_RELEASE_PAT }}
38+
39+
jobs:
40+
centralized-plugin-releases:
41+
runs-on: macos-26-xlarge
42+
timeout-minutes: 20
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Setup Gemini CLI
48+
uses: google-github-actions/run-gemini-cli@main
49+
with:
50+
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
51+
continue-on-error: true
52+
53+
- name: Update plugins
54+
id: update
55+
run: |
56+
# Build plugin filter args
57+
PLUGIN_ARGS=""
58+
if [ "${{ github.event.inputs.react_native }}" != "true" ]; then
59+
PLUGIN_ARGS="$PLUGIN_ARGS --skip-react-native"
60+
fi
61+
if [ "${{ github.event.inputs.cordova }}" != "true" ]; then
62+
PLUGIN_ARGS="$PLUGIN_ARGS --skip-cordova"
63+
fi
64+
if [ "${{ github.event.inputs.flutter }}" != "true" ]; then
65+
PLUGIN_ARGS="$PLUGIN_ARGS --skip-flutter"
66+
fi
67+
if [ "${{ github.event.inputs.capacitor }}" != "true" ]; then
68+
PLUGIN_ARGS="$PLUGIN_ARGS --skip-capacitor"
69+
fi
70+
71+
# Add test mode flag if enabled
72+
if [ "${{ github.event.inputs.test_mode }}" = "true" ]; then
73+
PLUGIN_ARGS="$PLUGIN_ARGS --test"
74+
fi
75+
76+
bash ./scripts/update_all_plugins.sh \
77+
"${{ github.event.inputs.proxy_version }}" \
78+
"${{ github.event.inputs.ios_version }}" \
79+
"${{ github.event.inputs.android_version }}" \
80+
$PLUGIN_ARGS
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.MOBILE_PLUGIN_RELEASE_PAT }}
83+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
84+
85+
- name: Display release summary
86+
run: |
87+
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
88+
## 📦 Plugin Release Summary
89+
90+
### Proxy Version
91+
**${{ github.event.inputs.proxy_version }}**
92+
93+
### SDK Versions
94+
- iOS: ${{ github.event.inputs.ios_version || 'from proxy' }}
95+
- Android: ${{ github.event.inputs.android_version || 'from proxy' }}
96+
97+
### Plugin PRs
98+
99+
| Plugin | Version | Status |
100+
|--------|---------|--------|
101+
| React Native | ${{ steps.update.outputs.react_native_version }} | ${{ steps.update.outputs.react_native_pr_url }} |
102+
| Cordova | ${{ steps.update.outputs.cordova_version }} | ${{ steps.update.outputs.cordova_pr_url }} |
103+
| Flutter | ${{ steps.update.outputs.flutter_version }} | ${{ steps.update.outputs.flutter_pr_url }} |
104+
| Capacitor | ${{ steps.update.outputs.capacitor_version }} | ${{ steps.update.outputs.capacitor_pr_url }} |
105+
106+
---
107+
108+
### Next Steps
109+
1. Review each plugin PR (links above)
110+
2. Merge when ready
111+
112+
⚠️ **Validation Note:** Changelogs across plugins will be similar since they update the same underlying SDKs. This is expected and correct.
113+
EOF
114+
115+
- name: Notify Slack (Success)
116+
if: success()
117+
run: |
118+
curl -X POST ${{ secrets.MOBILE_SLACK_WEBHOOK }} \
119+
-H 'Content-Type: application/json' \
120+
-d '{
121+
"text": "✅ Centralized plugin releases complete for proxy v${{ github.event.inputs.proxy_version }}\n• React Native v${{ steps.update.outputs.react_native_version }}: ${{ steps.update.outputs.react_native_pr_url }}\n• Cordova v${{ steps.update.outputs.cordova_version }}: ${{ steps.update.outputs.cordova_pr_url }}\n• Flutter v${{ steps.update.outputs.flutter_version }}: ${{ steps.update.outputs.flutter_pr_url }}\n• Capacitor v${{ steps.update.outputs.capacitor_version }}: ${{ steps.update.outputs.capacitor_pr_url }}\n@mobile-team"
122+
}' || true
123+
124+
- name: Notify Slack (Failure)
125+
if: failure()
126+
run: |
127+
curl -X POST ${{ secrets.MOBILE_SLACK_WEBHOOK }} \
128+
-H 'Content-Type: application/json' \
129+
-d '{
130+
"text": "❌ Centralized plugin release failed\nProxy version: ${{ github.event.inputs.proxy_version }}\nWorkflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n<@crow>"
131+
}' || true
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Prepare Proxy Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
BUNDLE_PATH: vendor/bundle
8+
9+
jobs:
10+
prepare-release:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Detect SDK versions
18+
id: detect
19+
run: |
20+
./scripts/detect_sdk_versions.sh
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Display version summary
25+
run: |
26+
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
27+
## 📦 Proxy Release Summary
28+
29+
| Component | Current | New |
30+
|-----------|---------|-----|
31+
| **Proxy** | - | **${{ steps.detect.outputs.proxy_version }}** |
32+
| **iOS SDK** | - | ${{ steps.detect.outputs.ios_version }} |
33+
| **Android SDK** | - | ${{ steps.detect.outputs.android_version }} |
34+
35+
**Bump Type:** `${{ steps.detect.outputs.bump_type }}`
36+
37+
---
38+
39+
Preparing release PR...
40+
EOF
41+
42+
- name: Prepare release
43+
run: |
44+
./scripts/prep_proxy_release.sh
45+
46+
- name: Create Pull Request
47+
id: cpr
48+
uses: peter-evans/create-pull-request@v6
49+
with:
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
commit-message: |
52+
Release ${{ steps.detect.outputs.proxy_version }}
53+
54+
- Updated iOS SDK to ${{ steps.detect.outputs.ios_version }}
55+
- Updated Android SDK to ${{ steps.detect.outputs.android_version }}
56+
branch: proxy-${{ steps.detect.outputs.proxy_version }}
57+
delete-branch: true
58+
title: Release ${{ steps.detect.outputs.proxy_version }}
59+
body: |
60+
## Proxy Release ${{ steps.detect.outputs.proxy_version }}
61+
62+
Automated release PR for proxy version bump.
63+
64+
### SDK Updates
65+
- iOS SDK: ${{ steps.detect.outputs.ios_version }}
66+
- Android SDK: ${{ steps.detect.outputs.android_version }}
67+
68+
---
69+
70+
🤖 Generated by prep-proxy-release workflow
71+
labels: |
72+
release
73+
automated pr
74+
75+
- name: Update summary with PR link
76+
if: steps.cpr.outputs.pull-request-number
77+
run: |
78+
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
79+
80+
## ✅ Release PR Created
81+
82+
**PR:** [#${{ steps.cpr.outputs.pull-request-number }}](${{ steps.cpr.outputs.pull-request-url }})
83+
84+
### Next Steps
85+
1. Review the PR
86+
2. Merge when ready
87+
3. Tag will be created automatically
88+
4. Run `prep-plugin-releases` workflow with version `${{ steps.detect.outputs.proxy_version }}`
89+
EOF
90+
91+
- name: Notify Slack (Success)
92+
if: success() && steps.cpr.outputs.pull-request-number
93+
run: |
94+
curl -X POST ${{ secrets.MOBILE_SLACK_WEBHOOK }} \
95+
-H 'Content-Type: application/json' \
96+
-d '{
97+
"text": "✅ Proxy release PR created: ${{ steps.cpr.outputs.pull-request-url }}\nVersion: ${{ steps.detect.outputs.proxy_version }}\niOS: ${{ steps.detect.outputs.ios_version }} | Android: ${{ steps.detect.outputs.android_version }}"
98+
}' || true
99+
100+
- name: Notify Slack (Failure)
101+
if: failure()
102+
run: |
103+
curl -X POST ${{ secrets.MOBILE_SLACK_WEBHOOK }} \
104+
-H 'Content-Type: application/json' \
105+
-d '{
106+
"text": "❌ Proxy release preparation failed\nWorkflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n<@crow>"
107+
}' || true

0 commit comments

Comments
 (0)