chore: switch to android-7 #41
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 and push Docker image | |
on: | |
push: | |
branches: | |
- master | |
- android-7 | |
pull_request: | |
schedule: | |
- cron: '0 2 * * 0' | |
workflow_dispatch: | |
env: | |
CI: true | |
DOCKER_BUILDKIT: 1 | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
CPU_ARCH: | |
- aarch64 | |
- arm | |
- i686 | |
- x86_64 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Setup binfmt_misc | |
if: (matrix.CPU_ARCH == 'aarch64') || (matrix.CPU_ARCH == 'arm') | |
run: docker run --rm --privileged aptman/qus -s -- -p aarch64 arm | |
- name: Build images | |
run: | | |
case '${{ matrix.CPU_ARCH }}' in | |
arm) SYSTEM_TYPE=arm; PLATFORM_TAG="linux/arm/v7";; | |
aarch64) SYSTEM_TYPE=arm; PLATFORM_TAG="linux/arm64";; | |
i686) SYSTEM_TYPE=x86; PLATFORM_TAG="linux/386";; | |
*) SYSTEM_TYPE=x86; PLATFORM_TAG="linux/amd64";; | |
esac | |
docker buildx build -t \ | |
ghcr.io/termux-user-repository/termux-docker-android-7:${{ matrix.CPU_ARCH }} \ | |
--platform "$PLATFORM_TAG" \ | |
--build-arg BOOTSTRAP_ARCH=${{ matrix.CPU_ARCH }} \ | |
--build-arg SYSTEM_TYPE="${SYSTEM_TYPE}" \ | |
. | |
- name: Login to Docker Hub | |
if: github.ref == 'refs/heads/android-7' && github.event_name != 'pull_request' && github.repository == 'termux-user-repository/termux-docker' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push | |
if: github.ref == 'refs/heads/android-7' && github.event_name != 'pull_request' && github.repository == 'termux-user-repository/termux-docker' | |
run: | | |
docker push ghcr.io/termux-user-repository/termux-docker-android-7:${{ matrix.CPU_ARCH }} | |
if [ ${{ matrix.CPU_ARCH }} = i686 ]; then | |
docker tag ghcr.io/termux-user-repository/termux-docker-android-7:i686 ghcr.io/termux-user-repository/termux-docker-android-7:latest | |
docker push ghcr.io/termux-user-repository/termux-docker-android-7:latest | |
fi | |
- name: Export container as tar archive | |
if: always() | |
run: | | |
docker run \ | |
--privileged \ | |
--name termux-docker-android-7-${{ matrix.CPU_ARCH }} \ | |
ghcr.io/termux-user-repository/termux-docker-android-7:${{ matrix.CPU_ARCH }} \ | |
uname -a | |
docker stop termux-docke-android-7r-${{ matrix.CPU_ARCH }} | |
docker export -o termux-docker-android-7-${{ matrix.CPU_ARCH }}.tar \ | |
termux-docker-android-7-${{ matrix.CPU_ARCH }} | |
sha256sum termux-docker-android-7-${{ matrix.CPU_ARCH }}.tar | |
- name: Store tar archive | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: termux-docker-android-7-${{ matrix.CPU_ARCH }}-${{ github.sha }} | |
path: termux-docker-android-7-${{ matrix.CPU_ARCH }}.tar |