Manual workflow with inputs #670
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow that is manually triggered | |
name: Manual workflow with inputs | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
type: choice | |
required: true | |
description: Environment | |
options: | |
- staging | |
- production | |
- blackwidow | |
- thanos | |
- thor | |
- drstrange | |
- hulk | |
jobs: | |
build-android: | |
runs-on: ubuntu-latest | |
outputs: | |
apkUrl: ${{ steps.diwaiAndroid.outputs.url }} | |
steps: | |
- name: Build Android with Appflow | |
uses: ionic-team/appflow-build@v1 | |
with: | |
token: ${{ secrets.APPFLOW_TOKEN }} | |
app-id: 32316914 | |
platform: Android | |
build-type: debug | |
environment: ${{ github.event.inputs.name }} | |
native-config: prod | |
upload-artifact: Android | |
- uses: actions/download-artifact@v3 | |
id: download | |
with: | |
name: 'Android' | |
path: ./ | |
- name: Rename file | |
run: mv *.apk android.apk | |
- name: Upload apk to diawi | |
uses: rnkdsh/[email protected] | |
id: diwaiAndroid | |
with: | |
token: ${{ secrets.DIAWI_TOKEN }} | |
file: android.apk | |
build-ios: | |
runs-on: ubuntu-latest | |
outputs: | |
iosURL: ${{ steps.diwaiIos.outputs.url }} | |
steps: | |
- name: Build iOS on Appflow | |
uses: ionic-team/appflow-build@v1 | |
with: | |
token: ${{ secrets.APPFLOW_TOKEN }} | |
app-id: 32316914 | |
platform: iOS | |
build-type: development | |
build-stack: macOS - 2024.04 - Apple silicon | |
certificate: Fyle signing | |
environment: ${{ github.event.inputs.name }} | |
native-config: prod | |
upload-artifact: ios | |
- uses: actions/download-artifact@v3 | |
id: ios | |
with: | |
name: 'ios' | |
path: ./ | |
- name: Rename file | |
run: mv *.ipa ios.ipa | |
- name: Upload ipa to diawi Slack | |
uses: rnkdsh/[email protected] | |
id: diwaiIos | |
with: | |
token: ${{ secrets.DIAWI_TOKEN }} | |
file: ios.ipa | |
send-to-slack: | |
needs: [build-android, build-ios] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get branch name | |
id: get-branch | |
uses: xom9ikk/split@v1 | |
with: | |
string: ${{ github.ref }} | |
separator: refs/heads/ | |
- name: Send Message to Slack | |
uses: archive/[email protected] | |
id: notify | |
with: | |
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }} | |
slack-channel: C029QPGHSQL | |
slack-text: ${{github.event.sender.login}} ran manual workflow on "${{ steps.get-branch.outputs._1 }}" branch \r\n PR link ${{github.event.pull_request.html_url}} \r\n \r\n *Description* \r\n ```${{github.event.pull_request.body}}``` \r\n \r\n APK Link ${{needs.build-android.outputs.apkURL}} \r\n IPA link ${{needs.build-ios.outputs.iosURL}} |