Skip to content

Commit

Permalink
Merge pull request #72 from urbanairship/automation
Browse files Browse the repository at this point in the history
Add initial pre-release workflow
  • Loading branch information
crow authored Dec 10, 2024
2 parents 8e048c4 + 93f9811 commit 16c1161
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Prepare Plugin Releases

on:
workflow_dispatch:
inputs:
proxy_version:
description: 'Framework Proxy Version (x.y.z)'
required: true
pattern: '^\d+\.\d+\.\d+$'
ios_version:
description: 'iOS SDK Version (x.y.z)'
required: false
pattern: '^\d+\.\d+\.\d+$'
android_version:
description: 'Android SDK Version (x.y.z)'
required: false
pattern: '^\d+\.\d+\.\d+$'

env:
GITHUB_TOKEN: ${{ secrets.PREPARE_RELEASES_PAT }}

jobs:
trigger-releases:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Trigger React Native Release
run: |
gh workflow run prep-release.yml \
-R urbanairship/react-native-airship \
-f react_native_version="${{ github.event.inputs.proxy_version }}" \
-f proxy_version="${{ github.event.inputs.proxy_version }}" \
$([ -n "${{ github.event.inputs.ios_version }}" ] && echo "-f ios_version=${{ github.event.inputs.ios_version }}") \
$([ -n "${{ github.event.inputs.android_version }}" ] && echo "-f android_version=${{ github.event.inputs.android_version }}")
- name: Trigger Flutter Release
run: |
gh workflow run prep-release.yml \
-R urbanairship/airship-flutter \
-f flutter_version="${{ github.event.inputs.proxy_version }}" \
-f proxy_version="${{ github.event.inputs.proxy_version }}" \
$([ -n "${{ github.event.inputs.ios_version }}" ] && echo "-f ios_version=${{ github.event.inputs.ios_version }}") \
$([ -n "${{ github.event.inputs.android_version }}" ] && echo "-f android_version=${{ github.event.inputs.android_version }}")
- name: Trigger Capacitor Release
run: |
gh workflow run prep-release.yml \
-R urbanairship/capacitor-airship \
-f capacitor_version="${{ github.event.inputs.proxy_version }}" \
-f proxy_version="${{ github.event.inputs.proxy_version }}" \
$([ -n "${{ github.event.inputs.ios_version }}" ] && echo "-f ios_version=${{ github.event.inputs.ios_version }}") \
$([ -n "${{ github.event.inputs.android_version }}" ] && echo "-f android_version=${{ github.event.inputs.android_version }}")
- name: Trigger Cordova Release
run: |
gh workflow run prep-release.yml \
-R urbanairship/urbanairship-cordova \
-f cordova_version="${{ github.event.inputs.proxy_version }}" \
-f proxy_version="${{ github.event.inputs.proxy_version }}" \
$([ -n "${{ github.event.inputs.ios_version }}" ] && echo "-f ios_version=${{ github.event.inputs.ios_version }}") \
$([ -n "${{ github.event.inputs.android_version }}" ] && echo "-f android_version=${{ github.event.inputs.android_version }}")
- name: Handle Success
if: success()
run: |
echo "Successfully triggered release preparations for all plugins"
- name: Handle Failure
if: failure()
run: |
echo "::error::Failed to trigger one or more plugin releases. Please check the logs above for details."
exit 1
- name: Slack Notification (Success)
if: success()
uses: homoluctus/slatify@master
with:
type: success
job_name: ":tada: Plugin release preparations triggered :tada:"
message: "@mobile-team Release preparations have been triggered for all plugins with proxy version v${{ github.event.inputs.proxy_version }} :rocket:"
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }}

- name: Slack Notification (Failure)
if: failure()
uses: homoluctus/slatify@master
with:
type: failure
job_name: ":disappointed: Plugin Release Preparations Failed :disappointed:"
message: "@crow Failed to trigger plugin release preparations. Please check the workflow logs. :sob:"
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }}

0 comments on commit 16c1161

Please sign in to comment.