Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/compute_changed_modules/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Compute changed modules
description: Detects changed modules and returns matrix JSON

inputs:
modules:
description: "Optional JSON array override"
required: false
default: ""

outputs:
value:
description: "JSON array of module paths"
Expand All @@ -15,6 +21,7 @@ runs:
steps:
- name: Changed files in libraries
id: changed
if: ${{ inputs.modules == '' }}
uses: tj-actions/changed-files@v45
with:
files: |
Expand All @@ -26,6 +33,20 @@ runs:
run: |
set -euo pipefail

if [[ -n '${{ inputs.modules }}' ]]; then
modules='${{ inputs.modules }}'
hasModules=$([[ "$modules" == "[]" ]] && echo false || echo true)

{
echo "value<<EOF"
echo "$modules"
echo "EOF"
echo "hasModules=$hasModules"
} >> "$GITHUB_OUTPUT"

exit 0
fi

if [[ "${{ steps.changed.outputs.any_changed }}" != "true" ]]; then
{
echo "value=[]"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:

status:
name: Status
needs: [checkstyle, build, test]
needs: [ build, test ]
runs-on: ubuntu-latest
if: always()

Expand Down
38 changes: 31 additions & 7 deletions .github/workflows/ci_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,37 @@ jobs:
uses: ./.github/actions/info

bump:
name: Bump module
name: Bump modules
if: ${{ (github.event.inputs.modules || '') != '' }}
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
max-parallel: 1
matrix:
module: ${{ fromJson(github.event.inputs.modules) }}
steps:
- name: Check out code
uses: actions/checkout@v6
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
persist-credentials: true

- name: Setup build environment
uses: ./.github/actions/setup

- name: Bump versions
uses: ./.github/actions/bump_version
with:
version: ${{ github.event.inputs.version }}
modules: ${{ github.event.inputs.modules }}
git-create-tag: ${{ github.event.inputs.create-tag }}
git-branch: ${{ github.ref_name }}
git-user-name: ${{ vars.CI_GIT_USER_NAME }}
git-user-email: ${{ vars.CI_GIT_USER_EMAIL }}

bump-bom:
name: Bump BOM version
needs: [ bump ]
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out code
Expand All @@ -74,7 +97,8 @@ jobs:
uses: ./.github/actions/bump_version
with:
version: ${{ github.event.inputs.version }}
module: ${{ matrix.module }}
modules: '[":bom"]'
git-create-tag: true
git-branch: ${{ github.ref_name }}
git-user-name: ${{ vars.CI_GIT_USER_NAME }}
git-user-email: ${{ vars.CI_GIT_USER_EMAIL }}
git-user-email: ${{ vars.CI_GIT_USER_EMAIL }}
45 changes: 33 additions & 12 deletions .github/workflows/ci_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
required: false
default: ''

bom-module:
description: 'BOM module name (used for version bumping, e.g. ":bom")'
required: false
default: ':bom'

build-type:
description: 'Build type (Debug or Release)'
required: false
Expand Down Expand Up @@ -46,6 +51,8 @@ env:
BUILD_TYPE: ${{ github.event.inputs.build-type || 'Release' }}
# Publishing type for Central Portal (USER_MANAGED or AUTOMATIC)
PUBLICATION_TYPE: ${{ github.event.inputs.publication-type || 'AUTOMATIC' }}
# BOM module name (used for version bumping)
BOM_MODULE: ${{ github.event.inputs.bom-module || ':bom' }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -80,9 +87,13 @@ jobs:
- name: Compute changed modules
id: computed
uses: ./.github/actions/compute_changed_modules
with:
modules: ${{ github.event.inputs.modules || '' }}

checkstyle:
name: Check code style
needs: [ computeChangedModules ]
if: ${{ needs.computeChangedModules.outputs.hasModules == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10

Expand All @@ -101,8 +112,7 @@ jobs:

build:
name: Build
needs: [ checkstyle, computeChangedModules ]
if: ${{ needs.computeChangedModules.outputs.hasModules == 'true' }}
needs: [ checkstyle ]
runs-on: ubuntu-latest
timeout-minutes: 20

Expand All @@ -129,8 +139,7 @@ jobs:

test:
name: Run Unit Tests
needs: [ checkstyle, computeChangedModules ]
if: ${{ needs.computeChangedModules.outputs.hasModules == 'true' }}
needs: [ checkstyle ]
runs-on: ubuntu-latest
timeout-minutes: 20

Expand All @@ -156,9 +165,9 @@ jobs:

publish:
name: Publish to Central (aggregation)
needs: [ build, test, computeChangedModules ]
if: ${{ needs.computeChangedModules.outputs.hasModules == 'true' }}
needs: [ build, test ]
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout repository
Expand All @@ -168,6 +177,18 @@ jobs:
- name: Setup build environment
uses: ./.github/actions/setup

- name: Build nmcpProjects
id: nmcp
shell: bash
run: |
set -euo pipefail

modules='${{ needs.computeChangedModules.outputs.modules }}'
nmcpProjects="$(echo "$modules" | jq -r --arg bom "${{ env.BOM_MODULE }}" '. + [$bom] | join(",")')"

echo "nmcpProjects=$nmcpProjects" >> "$GITHUB_OUTPUT"
echo "nmcpProjects: $nmcpProjects"

- name: Publish aggregation
env:
CENTRAL_PORTAL_USERNAME: ${{ secrets.CENTRAL_PORTAL_USERNAME }}
Expand All @@ -178,15 +199,15 @@ jobs:
shell: bash
run: |
./gradlew publishAggregationToCentralPortal \
-PnmcpProjects="${{ join(fromJson(needs.computeChangedModules.outputs.modules), ',') }}" \
-PnmcpProjects="${{ steps.nmcp.outputs.nmcpProjects }}" \
-PpublishingType="${{ env.PUBLICATION_TYPE }}" \
--no-configuration-cache

bump:
name: Bump version
needs: [ publish, computeChangedModules ]
if: ${{ needs.computeChangedModules.outputs.hasModules == 'true' }}
needs: [ publish ]
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out code
Expand Down Expand Up @@ -214,9 +235,9 @@ jobs:

bump-bom:
name: Bump BOM version
needs: [ bump, computeChangedModules ]
if: ${{ needs.computeChangedModules.outputs.hasModules == 'true' }}
needs: [ bump ]
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out code
Expand All @@ -237,7 +258,7 @@ jobs:
uses: ./.github/actions/bump_version
with:
version: ${{ steps.pr_info.outputs.bump }}
modules: '[":bom"]'
modules: '["${{ env.BOM_MODULE }}"]'
git-create-tag: true
git-branch: ${{ github.ref_name }}
git-user-name: ${{ vars.CI_GIT_USER_NAME }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
name: Generate reports
needs: [ test ]
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion libraries/android/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
MAJOR=5
DEV=0
MINOR=0
PATCH=29
PATCH=30
Loading