-
-
Notifications
You must be signed in to change notification settings - Fork 57
137 lines (116 loc) · 4.82 KB
/
Copy pathpublish-release.yml
File metadata and controls
137 lines (116 loc) · 4.82 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Deploy
on:
push:
tags:
- 'v*'
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: false
jobs:
deploy:
name: Build & Deploy to Play Store
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Version Name
run: echo "VERSION_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
~/.gradle/daemon
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle.kts', '**/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-
# Signing
- name: Decode keystore
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > universal-installer-release.jks
- name: Create key.properties
run: |
cat > key.properties <<EOF
storeFile=universal-installer-release.jks
storePassword=${{ secrets.STORE_PASSWORD }}
keyAlias=${{ secrets.KEY_ALIAS }}
keyPassword=${{ secrets.KEY_PASSWORD }}
EOF
- name: Decode Play Store key
run: echo "${{ secrets.PLAY_STORE_CONFIG_JSON }}" | base64 --decode > fastlane/play-store-key.json
# Enables the `play` flavor. Without this file :app has no play variants at all and every
# bundlePlayRelease below fails with "task not found" — see docs/FIREBASE.md.
- name: Decode Firebase config
run: |
mkdir -p app/src/play
echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > app/src/play/google-services.json
# Build & Deploy
- name: Grant execute permission
run: chmod +x gradlew
- name: Deploy to production track
id: play_store_production
continue-on-error: true
run: bundle exec fastlane production
- name: Deploy to closed testing track
id: play_store_beta
continue-on-error: true
run: bundle exec fastlane beta
- name: Deploy TV to production track
id: play_store_tv_production
continue-on-error: true
run: bundle exec fastlane production --fastlane_dir=fastlane_tv
- name: Deploy TV to closed testing track
id: play_store_tv_beta
continue-on-error: true
run: bundle exec fastlane beta --fastlane_dir=fastlane_tv
# Play got its AAB from the fastlane lanes above, built from the `play` flavor. GitHub
# gets the `opensource` flavor instead: same app, minus Firebase Analytics and
# Crashlytics, which is the build we distribute as open source.
- name: Build release APK & AAB
run: ./gradlew :app:assembleOpensourceRelease :app:bundleOpensourceRelease :tv:assembleRelease :tv:bundleRelease
# The flavor dimension renamed these to app-opensource-release.*, but two downstream
# consumers key off the old names: F-Droid's recipe pins `binary:` to app-release.apk for
# its reproducible-build check, and IzzyOnDroid picks its APK out of the release by name
# (the release also carries tv-release.apk). Rename back rather than break both.
- name: Restore the published artifact names
run: |
mv app/build/outputs/apk/opensource/release/app-opensource-release.apk \
app/build/outputs/apk/opensource/release/app-release.apk
mv app/build/outputs/bundle/opensourceRelease/app-opensource-release.aab \
app/build/outputs/bundle/opensourceRelease/app-release.aab
# Artifacts
- name: Upload release AAB & APK
uses: actions/upload-artifact@v4
with:
name: release-build
path: |
app/build/outputs/bundle/opensourceRelease/app-release.aab
app/build/outputs/apk/opensource/release/app-release.apk
tv/build/outputs/bundle/release/tv-release.aab
tv/build/outputs/apk/release/tv-release.apk
retention-days: 30
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.VERSION_NAME }}
draft: false
prerelease: false
files: |
app/build/outputs/apk/opensource/release/app-release.apk
app/build/outputs/bundle/opensourceRelease/app-release.aab
tv/build/outputs/apk/release/tv-release.apk
tv/build/outputs/bundle/release/tv-release.aab
token: ${{ secrets.GITHUB_TOKEN }}