Skip to content

Update protobuf wrap #6

Update protobuf wrap

Update protobuf wrap #6

Workflow file for this run

name: Compile and check on supported systems
on: [push, pull_request]
jobs:
upload-src:
name: Upload the source
runs-on: ubuntu-latest
steps:
# - name: Cache source
# id: cache
# uses: actions/cache@v4
# with:
# path: android-tools-source.tar.xz
# key: build-cache
- name: prep ubuntu
# if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -yq \
cmake git meson
- name: checkout
# if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
timeout-minutes: 15
with:
path: android-tools-source
submodules: true
- name: build & install
# if: steps.cache.outputs.cache-hit != 'true'
timeout-minutes: 5
run: |
export SOURCE_DATE_EPOCH=$(date +%s)
echo "SOURCE_DATE_EPOCH: ${SOURCE_DATE_EPOCH}"
meson subprojects download --sourcedir android-tools-source
patch -d android-tools-source -p1 < android-tools-source/onlypatch.patch
meson setup unused_build android-tools-source -Duse_bundled_libusb=true
patch -d android-tools-source -Rp1 < android-tools-source/onlypatch.patch
rm -rf android-tools-source/.git android-tools-source/subprojects/packagecache android-tools-source/vendor/*/.git
touch android-tools-source/nopatch
tar -cf android-tools-source.tar android-tools-source/
- name: upload package_source
uses: actions/upload-artifact@v4
with:
name: package_source
path: android-tools-source.tar
linux:
runs-on: ubuntu-latest
needs: [upload-src]
strategy:
fail-fast: false
matrix:
include:
# gcc is required in clang builds on opensuse; the clang package on its
# own cannot compile C++, it is missing vital dependencies (a linker,
# some gcc libraries...). gcc-c++ should pull in all of it.
- os: "opensuse/leap:latest"
pkgs: "clang gcc11-c++"
env1: "CC=clang CXX=clang++"
- os: "opensuse/tumbleweed"
pkgs: "gcc gcc-c++"
- os: "opensuse/tumbleweed"
pkgs: "clang gcc-c++"
env1: "CC=clang CXX=clang++"
- os: "archlinux:base"
pkgs: gcc
- os: "archlinux:base"
pkgs: clang
env1: "CC=clang CXX=clang++"
- os: "ubuntu:24.04"
pkgs: "gcc-10 g++-10"
env1: "CC=gcc-10 CXX=g++-10"
- os: "ubuntu:24.04"
pkgs: "clang-15 libstdc++-10-dev"
env1: "CC=clang-15 CXX=clang++-15"
- os: "alpine"
pkgs: "gcc"
env1: "CC=gcc CXX=g++"
- os: "fedora:latest"
pkgs: "gcc gcc-g++"
- os: "fedora:rawhide"
pkgs: "gcc gcc-g++"
container:
image: ${{ matrix.os }}
# New versions of glibc use the new clone3() syscall which has not
# yet been whitelisted in GitHub's secomp profile. To prevent jobs
# using these distros from failing (e.g. openSUSE) change the
# secomp policy.
#
# See https://github.com/nmeum/android-tools/pull/48#issuecomment-944893176
options: --security-opt seccomp=unconfined
steps:
- name: prep opensuse
if: startsWith(matrix.os, 'opensuse')
run: |
zypper -n ref
zypper -n in ${{ matrix.pkgs }} cmake meson tar
- name: prep archlinux
if: startsWith(matrix.os, 'archlinux')
run: |
pacman -Syu --needed --noconfirm \
${{ matrix.pkgs }} cmake meson
- name: prep ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -yq \
${{ matrix.pkgs }} cmake meson
- name: prep alpine
if: startsWith(matrix.os, 'alpine')
run: |
apk add build-base meson cmake linux-headers
- name: prep fedora
if: startsWith(matrix.os, 'fedora')
# libatomic is needed because of https://github.com/mesonbuild/meson/issues/14946
run: |
dnf install -y ${{ matrix.pkgs }} cmake meson libatomic
- name: download source
uses: actions/download-artifact@v4
with:
name: package_source
- name: build & install
run: |
tar -xf android-tools-*.tar
cd android-tools-*/
test -n "${{ matrix.env1 }}" && export ${{ matrix.env1 }}
test -n "${{ matrix.env2 }}" && export ${{ matrix.env2 }}
meson setup build -Duse_bundled_libusb=true \
--native-file nativefiles/release_configuration.ini \
--prefix /usr/local
echo -e "\n### install ###\n"
meson install -C build
echo -e "\n### all done ###\n"
- name: check
run: |
/usr/local/bin/adb --version
/usr/local/bin/fastboot --version
# /usr/local/bin/make_f2fs -V
# /usr/local/bin/sload_f2fs -V
macos:
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14, macos-15]
runs-on: ${{ matrix.os }}
needs: [upload-src]
steps:
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
# Borrowed from https://github.com/mesonbuild/meson/blob/master/.github/workflows/macos.yml#L87-L92
- name: unbreak python in github actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
- name: prep macos
run: |
rm -rf /opt/homebrew/include/openssl /usr/local/opt/openssl /usr/local/include/openssl
brew install --overwrite --quiet meson
- name: download source
uses: actions/download-artifact@v4
with:
name: package_source
- name: build & install
run: |
tar -xf android-tools-*.tar
cd android-tools-*/
meson setup build -Duse_bundled_libusb=true \
--native-file nativefiles/release_configuration.ini \
--prefix "$HOME/android-tools"
echo -e "\n### install ###\n"
meson install -C build
echo -e "\n### all done ###\n"
- name: check
run: |
$HOME/android-tools/bin/adb --version
$HOME/android-tools/bin/fastboot --version
# $HOME/android-tools/bin/make_f2fs -V
# $HOME/android-tools/bin/sload_f2fs -V
windows:
runs-on: windows-2022
needs: [upload-src]
steps:
- name: prep MSYS2
uses: msys2/[email protected]
with:
msystem: UCRT64
install: >
mingw-w64-ucrt-x86_64-meson
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-nasm
- name: download source
uses: actions/download-artifact@v4
with:
name: package_source
- name: extract source
timeout-minutes: 10
run: tar -oxf android-tools-source.tar
- name: build & install
shell: msys2 {0}
run: |
cd android-tools-*/
meson setup build -Duse_bundled_libusb=true \
--native-file nativefiles/release_configuration.ini \
--native-file nativefiles/release_configuration_fullstatic.ini \
--native-file nativefiles/release_configuration_standardlayout.ini
echo -e "\n### install ###\n"
meson install -C build --destdir "$PWD/../android-tools"
echo -e "\n### all done ###\n"
- name: check
run: |
.\android-tools\adb.exe --version
.\android-tools\fastboot.exe --version
# .\android-tools\make_f2fs.exe -V
# .\android-tools\sload_f2fs.exe -V