-
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (93 loc) · 4.55 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Publishes a build to app store.
# Normally, you can use the publishToIOS, publishToAndroid[Alpha|Beta|Release] workflows instead,
# which are more convenient wrappers around this workflow
#
# Read: https://docs.expo.dev/submit/eas-json/
# To read about to submit to the app stores:
# Android: https://docs.expo.dev/submit/android/
# iOS: https://docs.expo.dev/submit/ios/
name: Z_Publish Helper
on:
workflow_dispatch:
inputs:
runId:
type: string
description: "The workflow whose build artifacts to submit to the app store, as in https://github.com/BloomBooks/BloomReader-Lite/actions/runs/[runId]"
required: true
platform:
type: choice
description: "Which mobile platforms to build"
required: true
default: "android"
options:
- android
- ios
releaseChannel:
type: choice
description: "type of release"
required: true
default: "beta"
options:
- alpha # Android's "Internal Test". Not compatible with iOS
- beta # Android's "Open Test" or iOS "TestFlight"
- release # Android: self-explanatory. iOS: I'm not sure if this is really necessary. I think you maybe publish "beta" first, and then promote it from the appstoreconnect.apple.com website?
# Definitely no need for beta-internal or release-internal for the publish workflow. The *-internal channels are designed only for device testing
# ENHANCE: Given the differences between Android and iOS,
# perhaps it makes more sense to refactor such that
# the options are "Android - Alpha", "Android - Beta", "Android - Release", and "iOS - Beta"
workflow_call:
inputs:
runId:
type: string
required: true
platform:
type: string
required: true
releaseChannel:
type: string
required: true
run-name: Publish ${{ inputs.platform }} - ${{ inputs.releaseChannel }} (${{ inputs.runId }})
jobs:
publish-mobile:
name: Publish ${{ inputs.platform }} - ${{ inputs.releaseChannel }}
runs-on: ubuntu-latest
steps:
- name: Check for EXPO_TOKEN
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
exit 1
fi
working-directory: ./
- name: Checkout repository
uses: actions/checkout@v3
# Documentation: https://github.com/marketplace/actions/download-workflow-artifact
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
run_id: ${{ inputs.runId }}
path: ./packages/mobile/artifacts
name: BloomReaderLite-${{ inputs.platform }}-${{ inputs.releaseChannel }}
search_artifacts: true
- name: "Debug: List directory contents"
run: ls -l artifacts
working-directory: packages/mobile
- name: Find Build Artifact
id: find-build-artifact
# Note: We are expecting the artifacts folder to only contain one file in it, which is the APK or IPA file for the requested platform/releaseChannel
run: |
artifact_path=$(find ./artifacts -name 'build-*')
echo "artifact=$artifact_path" >> $GITHUB_OUTPUT
# Note: It is more straightforward if this is run from the same directory that "eas submit" will be run from.
working-directory: packages/mobile
- name: Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: "EAS Submit"
run: eas submit --path ${{ steps.find-build-artifact.outputs.artifact }} --platform ${{ inputs.platform }} --profile ${{ inputs.releaseChannel }} --non-interactive
working-directory: packages/mobile
env:
EXPO_APPLE_ID: ${{ secrets.EXPO_APPLE_ID }}