Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial pre-release workflow #72

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading