Skip to content

Commit 43fd18a

Browse files
authored
chore: improve app distribution for dev and prod (#969)
* chore: improve app distribution for dev and prod * chore: always skip draft
1 parent 7c89361 commit 43fd18a

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

.github/workflows/app-distribute.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
release:
8+
types: [published]
79

810
workflow_dispatch:
911
inputs:
@@ -48,7 +50,7 @@ jobs:
4850
name: Build and Distribute Dogfooding Ios
4951
runs-on: macos-15
5052
timeout-minutes: 60
51-
if: ${{ github.event_name == 'push' || inputs.build_ios == true }}
53+
if: ${{ github.event_name == 'push' || github.event_name == 'release' || inputs.build_ios == true }}
5254
steps:
5355
- name: Install Bot SSH Key
5456
uses: webfactory/[email protected]
@@ -88,9 +90,11 @@ jobs:
8890
- name: Set build flavor to Env
8991
run: |
9092
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
91-
FLAVOR=${{ inputs.flavor }}
93+
FLAVOR=${{ inputs.flavor }}
94+
elif [[ ${{ github.event_name == 'release' }} == true ]]; then
95+
FLAVOR=prod
9296
else
93-
FLAVOR=beta
97+
FLAVOR=beta
9498
fi
9599
echo "FLAVOR=$FLAVOR" >> $GITHUB_ENV
96100
@@ -103,7 +107,7 @@ jobs:
103107
name: Build and Distribute Dogfooding Android
104108
runs-on: ubuntu-latest
105109
timeout-minutes: 30
106-
if: ${{ github.event_name == 'push' || inputs.build_android == true }}
110+
if: ${{ github.event_name == 'push' || github.event_name == 'release' || inputs.build_android == true }}
107111
steps:
108112
- name: Checkout code
109113
uses: actions/checkout@v3
@@ -146,9 +150,11 @@ jobs:
146150
- name: Set build flavor to Env
147151
run: |
148152
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
149-
echo "FLAVOR=${{ inputs.flavor }}" >> $GITHUB_ENV
153+
echo "FLAVOR=${{ inputs.flavor }}" >> $GITHUB_ENV
154+
elif [[ ${{ github.event_name == 'release' }} == true ]]; then
155+
echo "FLAVOR=prod" >> $GITHUB_ENV
150156
else
151-
echo "FLAVOR=beta" >> $GITHUB_ENV
157+
echo "FLAVOR=beta" >> $GITHUB_ENV
152158
fi
153159
154160
- name: Build and Distribute
@@ -160,7 +166,7 @@ jobs:
160166
name: Build and Deploy Dogfooding Web
161167
runs-on: ubuntu-latest
162168
timeout-minutes: 10
163-
if: ${{ github.event_name == 'push' || inputs.build_web == true }}
169+
if: ${{ github.event_name == 'push' || github.event_name == 'release' || inputs.build_web == true }}
164170
steps:
165171
- name: Checkout code
166172
uses: actions/checkout@v3

dogfooding/android/fastlane/Fastfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ platform :android do
2626

2727
build_appbundle(flavor: options[:flavor])
2828

29+
is_prod = options[:flavor] == 'prod'
30+
2931
upload_to_play_store(
30-
track: 'internal',
32+
track: is_prod ? 'production' : 'internal',
3133
aab: "../build/app/outputs/bundle/#{options[:flavor]}Release/app-#{options[:flavor]}-release.aab",
3234
skip_upload_screenshots: true,
3335
skip_upload_images: true,
34-
release_status: "draft"
36+
skip_upload_changelogs: true,
37+
release_status: "completed"
3538
)
3639
end
3740
end

dogfooding/ios/fastlane/Fastfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ platform :ios do
6868
flavor: options[:flavor]
6969
)
7070

71+
is_prod = options[:flavor] == 'prod'
72+
7173
begin
7274
upload_to_testflight(
7375
api_key: appstore_api_key,
74-
distribute_external: true,
75-
notify_external_testers: true,
76-
groups: ['Internal Testers', 'External Testers'],
76+
distribute_external: is_prod,
77+
notify_external_testers: false,
78+
groups: is_prod ? ['Internal Testers', 'External Testers'] : ['Internal Testers'],
7779
changelog: 'Lots of amazing new features to test out!',
7880
reject_build_waiting_for_review: false,
7981
skip_waiting_for_build_processing: false,

0 commit comments

Comments
 (0)