Files
lunasea/.github/workflows/prepare_channels.yml
2022-03-31 14:33:49 -04:00

140 lines
3.8 KiB
YAML

name: Prepare Channels
on:
workflow_call:
inputs:
ref:
type: string
required: true
outputs:
android:
description: "Android Deployment Channel"
value: ${{ jobs.android.outputs.output1 }}
ios:
description: "iOS Deployment Channel"
value: ${{ jobs.ios.outputs.output1 }}
linux:
description: "Linux Deployment Channel"
value: ${{ jobs.linux.outputs.output1 }}
macos:
description: "macOS Deployment Channel"
value: ${{ jobs.macos.outputs.output1 }}
jobs:
android:
name: Android
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.output.outputs.channel }}
steps:
- name: Run Script
id: script
uses: actions/github-script@v6
env:
FLAVOR: ${{ inputs.ref }}
with:
result-encoding: string
script: |
const ref = process.env.FLAVOR || "edge";
switch (ref) {
case "beta": return "alpha";
case "candidate": return "beta";
case "stable": return "production";
case "edge":
default: return "internal";
}
- name: Set Output
id: output
run: |
echo ${{ steps.script.outputs.result }}
echo "::set-output name=channel::${{ steps.script.outputs.result }}"
ios:
name: iOS
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.output.outputs.channel }}
steps:
- name: Run Script
id: script
uses: actions/github-script@v6
env:
FLAVOR: ${{ inputs.ref }}
with:
result-encoding: string
script: |
const ref = process.env.FLAVOR || "edge";
switch (ref) {
case "beta": return "beta";
case "candidate": return "candidate";
case "stable": return "stable";
case "edge":
default: return "edge";
}
- name: Set Output
id: output
run: |
echo ${{ steps.script.outputs.result }}
echo "::set-output name=channel::${{ steps.script.outputs.result }}"
linux:
name: Linux
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.output.outputs.channel }}
steps:
- name: Run Script
id: script
uses: actions/github-script@v6
env:
FLAVOR: ${{ inputs.ref }}
with:
result-encoding: string
script: |
const ref = process.env.FLAVOR || "edge";
switch (ref) {
case "beta": return "beta";
case "candidate": return "candidate";
case "stable": return "stable";
case "edge":
default: return "edge";
}
- name: Set Output
id: output
run: |
echo ${{ steps.script.outputs.result }}
echo "::set-output name=channel::${{ steps.script.outputs.result }}"
macos:
name: macOS
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.output.outputs.channel }}
steps:
- name: Run Script
id: script
uses: actions/github-script@v6
env:
FLAVOR: ${{ inputs.ref }}
with:
result-encoding: string
script: |
const ref = process.env.FLAVOR || "edge";
switch (ref) {
case "beta": return "beta";
case "candidate": return "candidate";
case "stable": return "stable";
case "edge":
default: return "edge";
}
- name: Set Output
id: output
run: |
echo ${{ steps.script.outputs.result }}
echo "::set-output name=channel::${{ steps.script.outputs.result }}"