Build master; les3v #260
This file contains hidden or 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: Build Android | |
| run-name: > | |
| ${{ inputs.deploy_google_play && 'Upload to Google Play' || 'Build' }} | |
| ${{ inputs.deploy_google_play && inputs.google_play_track || '' }} | |
| ${{ inputs.tag }}; ${{ inputs.app_selection }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| type: string | |
| description: Build a specific git tag | |
| required: true | |
| deploy_google_play: | |
| description: 'Upload to Google Play' | |
| required: true | |
| type: boolean | |
| default: false | |
| google_play_track: | |
| description: 'Google Play track, e.g. "internal", "production"' | |
| required: false | |
| type: string | |
| default: 'internal' | |
| app_selection: | |
| description: 'Select apps to build (e.g., "coopcycle, naofood" or "-kooglof, -robinfood")' | |
| required: false | |
| type: string | |
| default: '-robinfood, -eraman, -coopcycle_beta' | |
| jobs: | |
| filter-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| selected_apps: ${{ steps.set-matrix.outputs.selected_apps }} | |
| display_names: ${{ steps.set-matrix.outputs.display_names }} | |
| steps: | |
| - name: Filter apps based on input | |
| id: set-matrix | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const appConfig = [ | |
| { | |
| id: 'coopcycle', | |
| displayName: 'CoopCycle', | |
| params: { | |
| instance: null, | |
| instance_url: '', | |
| app_name: 'CoopCycle', | |
| primary_color: '', | |
| package_name: 'fr.coopcycle', | |
| keystore_key_alias: 'coopcycle', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'coopcycle_beta', | |
| displayName: 'CoopCycle (Beta)', | |
| params: { | |
| instance: 'beta', | |
| instance_url: '', | |
| app_name: 'CoopCycle (Beta)', | |
| primary_color: '', | |
| package_name: 'fr.coopcycle.beta', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'naofood', | |
| displayName: 'Naofood', | |
| params: { | |
| instance: 'naofood', | |
| instance_url: 'https://naofood.coopcycle.org', | |
| app_name: 'Naofood', | |
| primary_color: '#f8781f', | |
| package_name: 'fr.naofood.client', | |
| keystore_key_alias: 'naofood', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_NAOFOOD', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'kooglof', | |
| displayName: 'Kooglof', | |
| params: { | |
| instance: 'kooglof', | |
| instance_url: 'https://kooglof.coopcycle.org', | |
| app_name: 'Kooglof', | |
| primary_color: '#b4434e', | |
| package_name: 'fr.coopcycle.kooglof', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'robinfood', | |
| displayName: 'RobinFood', | |
| params: { | |
| instance: 'robinfood', | |
| instance_url: 'https://robinfood.coopcycle.org', | |
| app_name: 'Robin Food', | |
| primary_color: '#ff0000', | |
| package_name: 'fr.coopcycle.robinfood', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'coursiers_rennais', | |
| displayName: 'Les Coursiers Rennais', | |
| params: { | |
| instance: 'lcr', | |
| instance_url: 'https://lcr.coopcycle.org', | |
| app_name: 'Les Coursiers Rennais', | |
| primary_color: '#0A090A', | |
| package_name: 'fr.coopcycle.lcr', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'eraman', | |
| displayName: 'Eraman', | |
| params: { | |
| instance: 'eraman', | |
| instance_url: 'https://eramangasteiz.coopcycle.org', | |
| app_name: 'Eraman', | |
| primary_color: '#317764', | |
| package_name: 'fr.coopcycle.eraman', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'sicklo', | |
| displayName: 'Sicklo', | |
| params: { | |
| instance: 'sicklo', | |
| instance_url: 'https://sicklo.coopcycle.org', | |
| app_name: 'Sicklo', | |
| primary_color: '#1f2632', | |
| package_name: 'fr.coopcycle.sicklo', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'coursiersmontpellier', | |
| displayName: 'Les Coursiers MTP', | |
| params: { | |
| instance: 'coursiersmontpellier', | |
| instance_url: 'https://coursiersmontpellier.coopcycle.org', | |
| app_name: 'Les Coursiers MTP', | |
| primary_color: '#004D9B', | |
| package_name: 'fr.coopcycle.coursiersmtp', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_COURSIERS_MTP_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'weku', | |
| displayName: 'WEKU', | |
| params: { | |
| instance: 'weku', | |
| instance_url: 'https://wekuyummy.coopcycle.org', | |
| app_name: 'WEKU', | |
| primary_color: '#015b38', | |
| package_name: 'fr.coopcycle.weku', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_WEKU_BASE64' | |
| } | |
| }, | |
| { | |
| id: 'les3v', | |
| displayName: 'Les 3V', | |
| params: { | |
| instance: 'les3v', | |
| instance_url: 'https://les3v.coopcycle.org', | |
| app_name: 'Les 3V', | |
| primary_color: '#F6EDDA', | |
| package_name: 'fr.coopcycle.les3v', | |
| keystore_key_alias: 'instance', | |
| keystore_key_password_secret: 'SIGNING_KEY_PASSWORD_INSTANCE', | |
| google_services_json: 'GOOGLE_SERVICES_JSON_BASE64' | |
| } | |
| } | |
| ]; | |
| const allAppIds = appConfig.map(app => app.id); | |
| let selectedApps = [...allAppIds]; | |
| const selectionInput = '${{ inputs.app_selection }}'; | |
| if (selectionInput) { | |
| const selections = selectionInput.split(',').map(s => s.trim()); | |
| const isExclusionMode = selections.every(s => s.startsWith('-')); | |
| if (isExclusionMode) { | |
| const excludeApps = selections.map(s => s.substring(1)); | |
| selectedApps = allAppIds.filter(app => !excludeApps.includes(app)); | |
| } else { | |
| selectedApps = selections.filter(app => allAppIds.includes(app)); | |
| } | |
| } | |
| const selectedAppConfigs = appConfig.filter(app => selectedApps.includes(app.id)); | |
| const displayNames = selectedAppConfigs | |
| .map(app => `; ${app.displayName}`) | |
| .join(''); | |
| console.log(`Selected apps: ${selectedApps.join(', ')}`); | |
| core.setOutput('selected_apps', JSON.stringify(selectedApps)); | |
| core.setOutput('matrix', JSON.stringify(selectedAppConfigs)); | |
| core.setOutput('display_names', displayNames); | |
| build-apps: | |
| needs: filter-matrix | |
| name: ${{ matrix.app.displayName }} | |
| strategy: | |
| matrix: | |
| app: ${{ fromJson(needs.filter-matrix.outputs.matrix) }} | |
| fail-fast: false | |
| uses: ./.github/workflows/fastlane_android.yml | |
| with: | |
| tag: ${{ inputs.tag }} | |
| instance: ${{ matrix.app.params.instance }} | |
| instance_url: ${{ matrix.app.params.instance_url }} | |
| app_name: ${{ matrix.app.params.app_name }} | |
| primary_color: ${{ matrix.app.params.primary_color }} | |
| package_name: ${{ matrix.app.params.package_name }} | |
| keystore_key_alias: ${{ matrix.app.params.keystore_key_alias }} | |
| keystore_key_password_secret: ${{ matrix.app.params.keystore_key_password_secret }} | |
| google_services_json: ${{ matrix.app.params.google_services_json }} | |
| deploy_google_play: ${{ inputs.deploy_google_play }} | |
| google_play_track: ${{ inputs.google_play_track }} | |
| secrets: inherit |