Skip to content

Commit

Permalink
Cherry pick PR #2455: Keep built Android APKs as artifacts (#2772)
Browse files Browse the repository at this point in the history
Refer to the original PR: #2455

Preserves built APKs in a single bundle for all architectures.
This is intended to keep APKs with every release.
    
b/290121545
b/318577880
  • Loading branch information
kaidokert committed Mar 29, 2024
2 parents 7c20846 + d8426da commit a387385
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/android_24.lts.1+.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: android_24.lts.1+

on:
release:
types: [prereleased, released, published]
pull_request:
types: [ready_for_review, opened, reopened, synchronize, labeled]
branches:
Expand Down Expand Up @@ -28,6 +30,7 @@ jobs:
with:
platform: android-arm64
nightly: ${{ github.event.inputs.nightly }}
keep_artifacts: cobalt.apk
android-x86:
uses: ./.github/workflows/main.yaml
permissions:
Expand All @@ -36,6 +39,7 @@ jobs:
with:
platform: android-x86
nightly: ${{ github.event.inputs.nightly }}
keep_artifacts: cobalt.apk
android-arm:
uses: ./.github/workflows/main.yaml
permissions:
Expand All @@ -44,3 +48,49 @@ jobs:
with:
platform: android-arm
nightly: ${{ github.event.inputs.nightly }}
keep_artifacts: cobalt.apk

upload-release-artifacts:
runs-on: ubuntu-latest
needs: [ android-arm, android-arm64, android-x86 ]
permissions:
actions: write
steps:
- name: Download arm-gold apk
uses: actions/download-artifact@v4
with:
name: android-arm-gold
path: arm-gold
- name: Download arm-qa apk
uses: actions/download-artifact@v4
with:
name: android-arm-qa
path: arm-qa
- name: Download arm64-gold apk
uses: actions/download-artifact@v4
with:
name: android-arm64-gold
path: arm64-gold
- name: Download arm64-qa apk
uses: actions/download-artifact@v4
with:
name: android-arm64-gold
path: arm64-qa
- name: Download x86-gold apk
uses: actions/download-artifact@v4
with:
name: android-x86-gold
path: x86-gold
- name: Download x86-qa apk
uses: actions/download-artifact@v4
with:
name: android-x86-qa
path: x86-qa
- name: 'Upload Android APKs'
uses: actions/upload-artifact@v4
with:
name: Android APKs
path: ./*
retention-days: 90
compression-level: 0 # We expect kept artifacts to be already compressed
if-no-files-found: error
14 changes: 14 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ on:
required: false
type: boolean
default: false
keep_artifacts:
description: 'Which artifacts to keep for releases'
required: false
type: string
default: ''

# Global env vars.
env:
Expand Down Expand Up @@ -210,6 +215,15 @@ jobs:
uses: ./.github/actions/gn
- name: Build Cobalt
uses: ./.github/actions/build
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
if: inputs.keep_artifacts
with:
name: ${{ matrix.platform }}-${{ matrix.config }}
path: out/${{ matrix.platform }}_${{ matrix.config }}/${{ inputs.keep_artifacts }}
retention-days: 7
compression-level: 0 # We expect kept artifacts to be already compressed
if-no-files-found: error
- name: Run API Leak Detector
uses: ./.github/actions/api_leak_detector
if: inputs.run_api_leak_detector
Expand Down

0 comments on commit a387385

Please sign in to comment.