forked from openfoodfacts/smooth-app
-
Notifications
You must be signed in to change notification settings - Fork 1
193 lines (175 loc) Β· 8.25 KB
/
release-please.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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Run release-please
on:
push:
branches:
- develop
env:
RUBY_VERSION: 3.2.0
jobs:
release-please:
runs-on: ubuntu-latest
if: github.repository_owner == 'openfoodfacts'
outputs:
release_created: ${{ steps.release_please.outputs.release_created }}
major: ${{ steps.release_please.outputs.major }}
minor: ${{ steps.release_please.outputs.minor }}
patch: ${{ steps.release_please.outputs.patch }}
tag_name: ${{ steps.release_please.outputs.tag_name }}
steps:
- name: Release-please
uses: google-github-actions/release-please-action@v4
id: release_please
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
pull-request-title-pattern: "chore${scope}: π Open Food Facts Mobile app - Release${component} ${version}."
changelog-types: '[{"type":"feat","section":"π Features","hidden":false},{"type":"fix","section":"π Bug Fixes","hidden":false},{"type":"docs","section":"π Documentation","hidden":false},{"type":"ci","section":"π€ Automation","hidden":false},{"type":"refactor","section":"π· Refactoring","hidden":false},{"type":"chore","section":"π Miscellaneous","hidden":false},{"type":"l10n","section":"π Translations","hidden":false}]'
create-release:
concurrency:
group: release
cancel-in-progress: false
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
outputs:
VERSION_NAME: ${{ steps.set_output.outputs.VERSION_NAME }}
VERSION_CODE: ${{ steps.set_output.outputs.VERSION_CODE }}
steps:
- uses: actions/checkout@v4
- name: Set VERSION_NAME env
run: echo "VERSION_NAME=${{ needs.release-please.outputs.major }}.${{ needs.release-please.outputs.minor }}.${{ needs.release-please.outputs.patch }}" >> $GITHUB_ENV
#run: echo "VERSION_NAME=1.9.0" >> $GITHUB_ENV
- name: Decrypt Android API JSON file
run: cd ./packages/smooth_app/android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh
env:
API_JSON_FILE_DECRYPTKEY: ${{ secrets.API_JSON_FILE_DECRYPTKEY }}
DECRYPT_GPG_KEYSTORE: ${{ secrets.DECRYPT_GPG_KEYSTORE }}
STORE_JKS_DECRYPTKEY: ${{ secrets.NEW_CYPHER }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ env.RUBY_VERSION }}
- name: bundle install
run: bundle install
working-directory: ./packages/smooth_app/android/
# We are using the android version code for iOS as well to have the version codes in sync
# in order for Sentry and other tools to work properly
# Outputs env: VERSION_CODE (integer)
- name: Get latest VERSION_CODE
uses: maierj/[email protected]
with:
lane: getOldVersionCode
subdirectory: packages/smooth_app/android
- name: Version
run: echo "${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}"
# We need to add the VERSION_CODE to the release in order for F-Droid to have the same VERSION_CODE as the other Stores
- name: Update release tag description
uses: rickstaa/action-create-tag@v1
continue-on-error: true
with:
tag: "v${{ env.VERSION_NAME }}"
message: "Public release: ${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}"
force_push_tag: true
# We need to add the VERSION_CODE to the release in order for F-Droid to have the same VERSION_CODE as the other Stores
- name: Create version file
run: echo ${{ env.VERSION_CODE }} > "./version-code.txt"
- name: Upload version code to release
uses: svenstaro/upload-release-action@v2
with:
file: ./version-code.txt
tag: "v${{ env.VERSION_NAME }}"
overwrite: true
- name: Set output
id: set_output
run: echo "::set-output name=VERSION_NAME::${{ env.VERSION_NAME }}" && echo "::set-output name=VERSION_CODE::${{ env.VERSION_CODE }}"
android-release:
concurrency:
group: android-release
cancel-in-progress: false
uses: openfoodfacts/smooth-app/.github/workflows/android-release-to-org-openfoodfacts-scanner.yml@develop
needs: [release-please, create-release]
if: ${{ needs.release-please.outputs.release_created }}
with:
VERSION_NAME: ${{ needs.create-release.outputs.VERSION_NAME}}
VERSION_CODE: ${{ needs.create-release.outputs.VERSION_CODE}}
RELEASE_TYPE: 'PLAY'
BUILD_TYPE: 'appbundle'
FLAVOR: 'main_google_play'
SCANNER: 'mlkit'
APP_REVIEW: 'google_play'
secrets:
API_JSON_FILE_DECRYPTKEY: ${{secrets.API_JSON_FILE_DECRYPTKEY }}
DECRYPT_GPG_KEYSTORE: ${{secrets.DECRYPT_GPG_KEYSTORE }}
STORE_JKS_DECRYPTKEY: ${{secrets.NEW_CYPHER }}
SIGN_STORE_PASSWORD: ${{secrets.DECRYPT_FOR_SCANNER_FILE }}
SIGN_KEY_ALIAS: ${{secrets.ALIAS_FOR_SCANNER }}
SIGN_KEY_PASSWORD: ${{secrets.KEY_FOR_SCANNER }}
iOS-release:
concurrency:
group: iOS-release
cancel-in-progress: false
uses: openfoodfacts/smooth-app/.github/workflows/ios-release-to-org-openfoodfacts-scanner.yml@develop
needs: [release-please, create-release]
if: ${{ needs.release-please.outputs.release_created }}
with:
VERSION_NAME: ${{ needs.create-release.outputs.VERSION_NAME}}
VERSION_CODE: ${{ needs.create-release.outputs.VERSION_CODE}}
secrets:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN }}
FASTLANE_USER: ${{secrets.FASTLANE_USER }}
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_GIT_URL: ${{secrets.MATCH_GIT_URL }}
MATCH_KEYCHAIN_PASSWORD: ${{secrets.MATCH_KEYCHAIN_PASSWORD }}
MATCH_PASSWORD: ${{secrets.MATCH_PASSWORD }}
PILOT_APPLE_ID: ${{secrets.PILOT_APPLE_ID }}
SPACESHIP_CONNECT_API_ISSUER_ID: ${{secrets.SPACESHIP_CONNECT_API_ISSUER_ID }}
SPACESHIP_CONNECT_API_KEY_ID: ${{secrets.SPACESHIP_CONNECT_API_KEY_ID }}
AUTH_KEY_FILE_DECRYPTKEY: ${{ secrets.AUTH_KEY_FILE_DECRYPTKEY }}
android-release-github:
concurrency:
group: android-release-github
cancel-in-progress: false
uses: openfoodfacts/smooth-app/.github/workflows/android-release-to-org-openfoodfacts-scanner.yml@develop
needs: [release-please, create-release]
if: ${{ needs.release-please.outputs.release_created }}
with:
VERSION_NAME: ${{ needs.create-release.outputs.VERSION_NAME}}
VERSION_CODE: ${{ needs.create-release.outputs.VERSION_CODE}}
RELEASE_TYPE: 'GITHUB'
BUILD_TYPE: 'apk'
TAG_NAME: ${{ needs.release-please.outputs.tag_name}}
FLAVOR: 'main_google_play'
SCANNER: 'mlkit'
APP_REVIEW: 'uri_store'
secrets:
API_JSON_FILE_DECRYPTKEY: ${{secrets.API_JSON_FILE_DECRYPTKEY }}
DECRYPT_GPG_KEYSTORE: ${{secrets.DECRYPT_GPG_KEYSTORE }}
STORE_JKS_DECRYPTKEY: ${{secrets.NEW_CYPHER }}
SIGN_STORE_PASSWORD: ${{secrets.DECRYPT_FOR_SCANNER_FILE }}
SIGN_KEY_ALIAS: ${{secrets.ALIAS_FOR_SCANNER }}
SIGN_KEY_PASSWORD: ${{secrets.KEY_FOR_SCANNER }}
android-release-github-fdroid:
concurrency:
group: android-release-github-fdroid
cancel-in-progress: false
uses: openfoodfacts/smooth-app/.github/workflows/android-release-to-org-openfoodfacts-scanner.yml@develop
needs: [release-please, create-release]
if: ${{ needs.release-please.outputs.release_created }}
with:
VERSION_NAME: ${{ needs.create-release.outputs.VERSION_NAME}}
VERSION_CODE: ${{ needs.create-release.outputs.VERSION_CODE}}
RELEASE_TYPE: 'GITHUB'
BUILD_TYPE: 'apk'
TAG_NAME: ${{ needs.release-please.outputs.tag_name}}
FLAVOR: 'main_fdroid'
SCANNER: 'zxing'
APP_REVIEW: 'uri_store'
secrets:
API_JSON_FILE_DECRYPTKEY: ${{secrets.API_JSON_FILE_DECRYPTKEY }}
DECRYPT_GPG_KEYSTORE: ${{secrets.DECRYPT_GPG_KEYSTORE }}
STORE_JKS_DECRYPTKEY: ${{secrets.NEW_CYPHER }}
SIGN_STORE_PASSWORD: ${{secrets.DECRYPT_FOR_SCANNER_FILE }}
SIGN_KEY_ALIAS: ${{secrets.ALIAS_FOR_SCANNER }}
SIGN_KEY_PASSWORD: ${{secrets.KEY_FOR_SCANNER }}