Skip to content

feat: implement unified build system [WPB-8645] #4059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

MohamadJaara
Copy link
Member

@MohamadJaara MohamadJaara commented Jun 11, 2025

EpicWPB-8645 [Android] Infrastructure code and developer experience


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

the current pipeline is hard to extend or change, and a lot of the stuff are not clearly visible

Solutions

Pipeline Architecture

  • Old System: Separate workflow files for each branch/environment
  • New System: Unified workflow with reusable components and matrix builds

Workflow Mapping

Branch/Trigger Old Workflow (DISABLED) New Workflow (ACTIVE)
develop branch build-develop-app.yml.disabled build-develop-unified.yml
main branch build-beta-app.yml.disabled build-main-unified.yml
release/candidate build-rc-app.yml.disabled build-release-candidate-unified.yml
Release events build-prod-app.yml.disabled build-production-unified.yml
F-Droid builds build-fdroid-app.yml.disabled Integrated into build-production-unified.yml
Edge/Internal build-edge-env.yml.disabled Integrated into build-develop-unified.yml

Key Improvements

1. Unified Architecture

  • Single base workflow: build-unified.yml handles all build logic
  • Reusable components: quality-gates.yml, deploy.yml
  • Consistent behavior: Same build process across all environments

2. Matrix-Based Builds

  • JSON configuration: Each trigger defines build matrix in JSON format
  • Flexible combinations: Flavor, variant, keystore, and deployment targets
  • Easy expansion: Add new build configurations without duplicating code

3. Enhanced Deployment

  • Multi-target deployment: S3, Google Play, GitHub Releases in single workflow
  • Automated internal testing: internal edge deployment is not automated for each push into develop

Build Configuration Examples

Develop Branch (Validation)

[
  {
    "flavor": "Dev",
    "variant": "Debug", 
    "keystore-type": "debug",
    "build-type": "apk",
    "generate-version-file": false,
    "deployment-targets": "[{\"type\": \"s3\"}]"
  },
  {
    "flavor": "Staging",
    "variant": "Compat",
    "keystore-type": "internal", 
    "build-type": "apk",
    "generate-version-file": false,
    "deployment-targets": "[{\"type\": \"s3\"}]"
  }
]

Production Release

[
  {
    "flavor": "Prod",
    "variant": "Compatrelease",
    "keystore-type": "public",
    "build-type": "both",
    "generate-version-file": true,
    "deployment-targets": "[{\"type\": \"s3\"}, {\"type\": \"google-play\", \"package-name\": \"com.wire\", \"track\": \"alpha\"}, {\"type\": \"github-release\", \"additional-files\": \"app/version.txt\"}]"
  }
]

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@MohamadJaara MohamadJaara force-pushed the mo/feat/improved-pipeline branch from ac489b2 to e043798 Compare June 11, 2025 14:53
Copy link
Contributor

Built wire-android-dev-debug-pr-4059.apk is available for download

Copy link

Copy link
Contributor

Built wire-android-dev-debug-pr-4059.apk is available for download

@MohamadJaara MohamadJaara changed the title feat: implement unified build system feat: implement unified build system [WPB-8645] Jun 13, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a unified build system for Wire Android by consolidating various branch‐specific workflows into a single, reusable, and matrix-based configuration. Key changes include:

  • Introduction of unified workflows for quality gates, build, deployment, and release management.
  • Consolidation of build configurations using JSON matrices for flexible, multi-target builds.
  • Addition of a composite action for keystore setup to streamline signing operations.

Reviewed Changes

Copilot reviewed 8 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/quality-gates.yml New workflow to run code analysis, UI tests, and unit tests with summary reporting.
.github/workflows/deploy.yml Deployment workflow supporting S3, Google Play, and GitHub Releases with lowercase conversion.
.github/workflows/build-unified.yml Unified build workflow orchestrating quality gates, environment setup, artifact generation, etc.
.github/workflows/build-release-candidate-unified.yml Unified build workflow for release candidate branch with validation and deployment support.
.github/workflows/build-production-unified.yml Unified build workflow for production releases including version comparison validation.
.github/workflows/build-main-unified.yml Unified build workflow for the main branch with trigger validation.
.github/workflows/build-develop-unified.yml Unified build workflow for the develop branch with support for internal and external deployments.
.github/actions/setup-keystore/action.yml Composite action to decode and set up the keystore based on the specified keystore type.
Comments suppressed due to low confidence (1)

.github/workflows/deploy.yml:51

  • There is an inconsistency in the naming between the input ('build-flavor') and the output variable ('build-flavour'). Please consider using consistent naming to avoid confusion.
          echo "build-flavour=$(echo '${{ inputs.build-flavor }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT


# Build matrix job - only runs if quality gates pass
build:
name: "Build ${{ matrix.flavor }}${{ matrix.variant }}"
Copy link
Preview

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The job name concatenates flavor and variant without a clear separator. Adding a delimiter (e.g., a hyphen) would improve readability.

Suggested change
name: "Build ${{ matrix.flavor }}${{ matrix.variant }}"
name: "Build ${{ matrix.flavor }}-${{ matrix.variant }}"

Copilot uses AI. Check for mistakes.

name: ${{ matrix.flavor }}-${{ matrix.variant }}-artifacts
path: |
app/build/outputs/
${{ matrix.generate-version-file == true && 'app/version.txt' || '' }}
Copy link
Preview

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The inline conditional for including the version file path could be made clearer by explicitly handling the true/false cases to ensure no unintended empty string values affect the artifact upload.

Suggested change
${{ matrix.generate-version-file == true && 'app/version.txt' || '' }}
${{ matrix.generate-version-file == true ? 'app/version.txt' : '' }}

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant