Support building from aosp-main #69
Workflow file for this run
This file contains 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 | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
archive: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: aarch64 | |
target: aosp_arm64 | |
link: https://dl.google.com/developers/android/udc/images/gsi/aosp_arm64-exp-UP1A.231005.007-10754064-68dd726a.zip | |
- arch: x86_64 | |
target: aosp_x86_64 | |
link: https://dl.google.com/developers/android/udc/images/gsi/aosp_x86_64-exp-UP1A.231005.007-10754064-84570261.zip | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Image | |
run: | | |
curl -fsSLo ${{ matrix.target }}.zip ${{ matrix.link }} | |
- name: Mount system.img | |
run: | | |
mkdir SYSTEM | |
unzip ${{ matrix.target }}.zip | |
sudo mount -o loop,ro system.img SYSTEM | |
- name: List Contents | |
run: | | |
cd SYSTEM | |
sudo find . -ls | |
- name: Archive | |
run: | | |
cd SYSTEM | |
sudo ../libexec/ls-files | sudo tar -cvzf ../${{ matrix.arch }}.tar.gz --no-recursion -T- | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.arch }} | |
path: ${{ matrix.arch }}.tar.gz | |
if-no-files-found: error | |
compression-level: 0 | |
build: | |
needs: [archive] | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
- name: Prepare | |
id: prepare | |
run: | | |
mkdir build | |
mv build-*/* build | |
- name: Docker Metadata | |
id: docker-metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=edge | |
type=ref,event=branch | |
type=ref,event=pr | |
type=ref,event=tag | |
type=schedule | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:master # need qemu >=8.2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
tags: ${{ steps.docker-metadata.outputs.tags }} | |
labels: ${{ steps.docker-metadata.outputs.labels }} |