Create internal releases of the Mobile app for Android & iOS #818
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create internal releases | |
on: | |
workflow_dispatch: | |
env: | |
RUBY_VERSION: 3.2.0 | |
jobs: | |
tag-commit: | |
concurrency: | |
group: release | |
cancel-in-progress: true | |
if: github.triggering_actor == 'teolemon' || github.triggering_actor == 'stephanegigandet' || github.triggering_actor == 'g123k' || github.triggering_actor == 'monsieurtanuki' || github.triggering_actor == 'M123-dev' | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION_NAME: ${{ steps.set_output.outputs.VERSION_NAME }} | |
VERSION_CODE: ${{ steps.set_output.outputs.VERSION_CODE }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: ${{ env.RUBY_VERSION }} | |
#working-directory: packages/smooth_app/android | |
- name: bundle install | |
run: bundle install | |
working-directory: ./packages/smooth_app/android/ | |
# Get the latest version name from file | |
- name: Set VERSION_NAME env | |
run: echo "VERSION_NAME=$(cat version.txt)">> $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 }} | |
# 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/fastlane-action@v3.0.0 | |
with: | |
lane: getOldVersionCode | |
subdirectory: packages/smooth_app/android | |
- name: Version | |
run: echo "${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}" | |
- name: Normalized tag | |
id: normalized_tag | |
run: echo "NORMALIZED_TAG=$(echo "internal_${{ env.VERSION_NAME }}_${{ env.VERSION_CODE }}" | tr "." "_")" >> $GITHUB_ENV | |
- name: Tag commit | |
uses: rickstaa/action-create-tag@v1 | |
continue-on-error: true | |
with: | |
tag: "${{ env.NORMALIZED_TAG }}" | |
message: "Internal release: ${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}" | |
force_push_tag: 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: true | |
uses: openfoodfacts/smooth-app/.github/workflows/android-release-to-org-openfoodfacts-scanner.yml@develop | |
needs: tag-commit | |
with: | |
VERSION_NAME: ${{ needs.tag-commit.outputs.VERSION_NAME}} | |
VERSION_CODE: ${{ needs.tag-commit.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: true | |
uses: openfoodfacts/smooth-app/.github/workflows/ios-release-to-org-openfoodfacts-scanner.yml@develop | |
needs: tag-commit | |
with: | |
VERSION_NAME: ${{ needs.tag-commit.outputs.VERSION_NAME}} | |
VERSION_CODE: ${{ needs.tag-commit.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 }} |