-
Notifications
You must be signed in to change notification settings - Fork 385
114 lines (93 loc) · 3.29 KB
/
Copy pathdistribute_external.yml
File metadata and controls
114 lines (93 loc) · 3.29 KB
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
107
108
109
110
111
112
113
114
name: distribute_external
on:
release:
types: [published]
workflow_dispatch:
inputs:
platform:
description: 'Platform to build (android, ios, or both)'
required: true
default: 'both'
type: choice
options:
- android
- ios
- both
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
determine_platforms:
runs-on: ubuntu-latest
outputs:
run_ios: ${{ steps.set_matrix.outputs.run_ios }}
run_android: ${{ steps.set_matrix.outputs.run_android }}
steps:
- name: Determine platforms to build
id: set_matrix
run: |
# Is this a release?
is_release="${{ github.event_name == 'release' }}"
# If it's a release event, build both platforms
if [[ "$is_release" == "true" ]]; then
echo "Building all platforms due to release"
echo "run_ios=true" >> $GITHUB_OUTPUT
echo "run_android=true" >> $GITHUB_OUTPUT
exit 0
fi
# For manual workflow dispatch, store platform in a variable
platform="${{ github.event.inputs.platform }}"
echo "Selected platform: $platform"
# Set outputs only if they should be true
[[ "$platform" == "ios" || "$platform" == "both" ]] && echo "run_ios=true" >> $GITHUB_OUTPUT || true
[[ "$platform" == "android" || "$platform" == "both" ]] && echo "run_android=true" >> $GITHUB_OUTPUT || true
android:
needs: determine_platforms
if: ${{ needs.determine_platforms.outputs.run_android == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Connect Bot
uses: webfactory/ssh-agent@v0.10.0
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
- name: "Git Checkout"
uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: ./.github/actions/setup-flutter
- uses: ./.github/actions/setup-ruby
- name: Distribute to S3
working-directory: sample_app/android
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
run: bundle exec fastlane distribute_to_s3
ios:
needs: determine_platforms
if: ${{ needs.determine_platforms.outputs.run_ios == 'true' }}
runs-on: macos-15 # Requires xcode 15 or later
steps:
- name: Connect Bot
uses: webfactory/ssh-agent@v0.10.0
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
- name: "Git Checkout"
uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.3'
- uses: ./.github/actions/setup-flutter
- name: "Disable Swift Package Manager"
run: flutter config --no-enable-swift-package-manager
- uses: ./.github/actions/setup-ruby
- name: Distribute to TestFlight
working-directory: sample_app/ios
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
run: bundle exec fastlane distribute_to_testflight