The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

gradle,ci: Sign CI APKs for Android release builds

Co-authored-by: Rylie Pavlik <rylie.pavlik@collabora.com>
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2209>

authored by

Korcan Hussein
Rylie Pavlik
and committed by
Rylie Pavlik
1e047b5b 68beca75

+55
+23
.gitlab-ci.yml
··· 367 367 extends: 368 368 - .monado.packaging.conditions 369 369 - .monado.image.debian:bookworm 370 + 370 371 before_script: 371 372 - pushd doc/changes 372 373 - proclamation build vNEXT ··· 385 386 stage: build 386 387 extends: 387 388 - .monado.image.debian:bookworm 389 + 388 390 script: 389 391 390 392 - .gitlab-ci/prebuild.sh ··· 395 397 stage: build 396 398 extends: 397 399 - .monado.image.debian:bookworm 400 + 398 401 script: 399 402 400 403 - .gitlab-ci/prebuild.sh ··· 405 408 stage: build 406 409 extends: 407 410 - .monado.image.debian:bookworm 411 + 408 412 script: 409 413 410 414 - .gitlab-ci/prebuild.sh ··· 415 419 stage: build 416 420 extends: 417 421 - .monado.image.debian:bookworm 422 + 418 423 script: 419 424 420 425 - .gitlab-ci/prebuild.sh ··· 425 430 stage: build 426 431 extends: 427 432 - .monado.image.debian:bullseye 433 + 428 434 script: 429 435 430 436 - .gitlab-ci/prebuild.sh ··· 435 441 stage: build 436 442 extends: 437 443 - .monado.image.debian:bookworm-ndk 444 + 438 445 script: 439 446 440 447 - .gitlab-ci/prebuild.sh ··· 444 451 stage: build 445 452 extends: 446 453 - .monado.image.debian:bookworm-ndk 454 + 447 455 script: 448 456 449 457 - .gitlab-ci/prebuild.sh ··· 453 461 stage: build 454 462 extends: 455 463 - .monado.image.debian:bookworm-ndk 464 + 456 465 before_script: 457 466 # For caching gradle stuff 458 467 - export GRADLE_USER_HOME=`pwd`/.gradlehome ··· 473 482 stage: build 474 483 extends: 475 484 - .monado.image.debian:bookworm-ndk 485 + 476 486 before_script: 477 487 # For caching gradle stuff 478 488 - export GRADLE_USER_HOME=`pwd`/.gradlehome ··· 496 506 stage: build 497 507 extends: 498 508 - .monado.image.debian:bookworm-ndk 509 + 499 510 before_script: 500 511 # For caching gradle stuff 501 512 - export GRADLE_USER_HOME=`pwd`/.gradlehome ··· 519 530 stage: build 520 531 extends: 521 532 - .monado.image.debian:bookworm-ndk 533 + - .monado.packaging.conditions 534 + 522 535 before_script: 523 536 # For caching gradle stuff 524 537 - export GRADLE_USER_HOME=`pwd`/.gradlehome ··· 533 546 script: 534 547 535 548 - .gitlab-ci/prebuild.sh 549 + - base64 --decode ${MONADO_ANDROID_KEYSTORE} > monado-release.jks 536 550 - .gitlab-ci/ci-gradle-build.sh assembleOutOfProcessRelease 537 551 artifacts: 538 552 paths: ··· 542 556 stage: build 543 557 extends: 544 558 - .monado.image.debian:bookworm-ndk 559 + - .monado.packaging.conditions 560 + 545 561 before_script: 546 562 # For caching gradle stuff 547 563 - export GRADLE_USER_HOME=`pwd`/.gradlehome ··· 556 572 script: 557 573 558 574 - .gitlab-ci/prebuild.sh 575 + - base64 --decode ${MONADO_ANDROID_KEYSTORE} > monado-release.jks 559 576 - .gitlab-ci/ci-gradle-build.sh assembleInProcessRelease 560 577 artifacts: 561 578 paths: ··· 565 582 stage: build 566 583 extends: 567 584 - .monado.image.ubuntu:focal 585 + 568 586 script: 569 587 570 588 - .gitlab-ci/prebuild.sh ··· 575 593 stage: build 576 594 extends: 577 595 - .monado.image.ubuntu:jammy 596 + 578 597 script: 579 598 580 599 - .gitlab-ci/prebuild.sh ··· 585 604 stage: build 586 605 extends: 587 606 - .monado.image.ubuntu:noble 607 + 588 608 script: 589 609 590 610 - .gitlab-ci/prebuild.sh ··· 595 615 stage: build 596 616 extends: 597 617 - .monado.image.arch 618 + 598 619 script: 599 620 600 621 - .gitlab-ci/prebuild.sh ··· 605 626 stage: build 606 627 extends: 607 628 - .monado.image.arch 629 + 608 630 script: 609 631 610 632 - .gitlab-ci/prebuild.sh ··· 615 637 stage: build 616 638 extends: 617 639 - .monado.image.alpine 640 + 618 641 script: 619 642 620 643 - .gitlab-ci/prebuild.sh
+2
.gitlab-ci/config.yml
··· 177 177 - name: android:outOfProcessRelease 178 178 target: assembleOutOfProcessRelease 179 179 artifact_path: src/xrt/targets/openxr_android/build/outputs/apk/outOfProcess 180 + extra_extends: .monado.packaging.conditions 180 181 181 182 - name: android:inProcessRelease 182 183 target: assembleInProcessRelease 183 184 artifact_path: src/xrt/targets/openxr_android/build/outputs/apk/inProcess 185 + extra_extends: .monado.packaging.conditions 184 186 185 187 - name: ubuntu 186 188 images:
+6
.gitlab-ci/templates/.gitlab-ci.yml.jinja
··· 108 108 - .monado.packaging.conditions 109 109 {% endif %} 110 110 - {{base_job_to_use_image(distro, image)}} 111 + {% if job.extra_extends %} 112 + - {{ job.extra_extends }} 113 + {% endif %} 111 114 112 115 {%- if job.before_script or "android" in job.name %} 113 116 ··· 140 143 {#- gradle builds -#} 141 144 {%- elif "android" in job.name %} 142 145 146 + {% if "Release" in job.name %} 147 + - base64 --decode ${MONADO_ANDROID_KEYSTORE} > monado-release.jks 148 + {% endif %} 143 149 - .gitlab-ci/ci-gradle-build.sh {{ job.target }} 144 150 145 151 {%- else %}
+1
doc/changes/misc_features/mr.2209.md
··· 1 + Sign main branch CI-generated APKs for Android release builds.
+23
src/xrt/targets/openxr_android/build.gradle
··· 49 49 String.join('.', components) 50 50 } 51 51 52 + project.ext.repoRoot = file('../../../../') 53 + 52 54 project.ext.renameLicense = { String name -> 53 55 def lowerNoExtension = name.toLowerCase().replace(".txt", "") 54 56 def result = lowerNoExtension.replaceAll(~/[\-.]/, "_") + ".txt" ··· 200 202 fatal 'StopShip' 201 203 } 202 204 205 + } 206 + 207 + // For signing of release binaries - env var must contain an absolute path 208 + // CI always does this. 209 + def keystorePropertiesFilename = System.getenv("MONADO_KEYSTORE_PROPERTIES") 210 + if (keystorePropertiesFilename) { 211 + def keystorePropertiesFile = file("${keystorePropertiesFilename}") 212 + if (keystorePropertiesFile.exists()) { 213 + println("Signing release artifacts for monado") 214 + def keystoreProperties = new Properties() 215 + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 216 + android.signingConfigs { 217 + release { 218 + keyAlias keystoreProperties['keyAlias'] 219 + keyPassword keystoreProperties['keyPassword'] 220 + storeFile file("${project.repoRoot}/" + keystoreProperties['storeFile']) 221 + storePassword keystoreProperties['storePassword'] 222 + } 223 + } 224 + android.buildTypes.release.signingConfig android.signingConfigs.release 225 + } 203 226 } 204 227 205 228 aboutLibraries {