ci: Add android builds of libgit2 #164
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: CI | |
on: | |
push: | |
branches: [master, release-*] | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+-*' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
env: | |
RID: ${{ matrix.name }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-2019 | |
name: win-x86 | |
param: -x86 | |
- os: windows-2019 | |
name: win-x64 | |
param: -x64 | |
- os: windows-2019 | |
name: win-arm64 | |
param: -arm64 | |
- os: ubuntu-24.04 | |
name: linux-x64 | |
- os: ubuntu-24.04 | |
name: linux-arm | |
- os: ubuntu-24.04 | |
name: linux-arm64 | |
- os: ubuntu-24.04 | |
name: linux-ppc64le | |
- os: ubuntu-24.04 | |
name: linux-musl-x64 | |
- os: ubuntu-24.04 | |
name: linux-musl-arm | |
- os: ubuntu-24.04 | |
name: linux-musl-arm64 | |
- os: macos-13 | |
name: osx-x64 | |
- os: macos-13 | |
name: osx-arm64 | |
- os: ubuntu-24.04 | |
name: android-arm | |
param: -android-arm | |
- os: ubuntu-24.04 | |
name: android-arm64 | |
param: -android-arm64 | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
submodules: true | |
- name: Build Windows | |
if: runner.os == 'Windows' | |
run: ./build.libgit2.ps1 ${{ matrix.param }} | |
- name: Build macOS | |
if: runner.os == 'macOS' | |
run: ./build.libgit2.sh | |
- name: Setup QEMU | |
if: contains(matrix.name, 'linux-musl-arm') | |
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset | |
- name: Setup Android NDK | |
if: contains(matrix.name, 'android') | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y unzip | |
wget https://dl.google.com/android/repository/android-ndk-r23b-linux.zip | |
unzip android-ndk-r23b-linux.zip | |
TOOLCHAIN_ROOT="$PWD/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64" | |
echo "ANDROID_TOOLCHAIN_ROOT=$TOOLCHAIN_ROOT" >> $GITHUB_ENV | |
echo "ANDROID_NDK=$PWD/android-ndk-r23b" >> $GITHUB_ENV | |
- name: Debug NDK | |
if: contains(matrix.name, 'android') | |
run: | | |
echo "ANDROID_NDK=$ANDROID_NDK" | |
echo "Contents of $ANDROID_NDK:" | |
ls -R $ANDROID_NDK | head -n 200 | |
echo "ANDROID_TOOLCHAIN_ROOT=$ANDROID_TOOLCHAIN_ROOT" | |
echo "Contents of $ANDROID_TOOLCHAIN_ROOT/bin:" | |
ls -l $ANDROID_TOOLCHAIN_ROOT/bin | head -n 50 | |
- name: Build Linux | |
if: runner.os == 'Linux' && (!contains(matrix.name, 'android')) | |
run: ./dockerbuild.sh | |
- name: Build for Android | |
if: runner.os == 'Linux' && contains(matrix.name, 'android') | |
run: ./build.libgit2.sh | |
- name: Upload artifacts | |
uses: actions/[email protected] | |
with: | |
name: ${{ matrix.name }} | |
path: nuget.package/runtimes/${{ matrix.name }} | |
package: | |
name: Create package | |
needs: build | |
runs-on: ubuntu-24.04 | |
env: | |
DOTNET_NOLOGO: true | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET SDK | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 9.0.x | |
- name: Download artifacts | |
uses: actions/[email protected] | |
with: | |
path: nuget.package/runtimes/ | |
- name: Create package | |
run: dotnet pack nuget.package | |
- name: Upload NuGet package | |
uses: actions/[email protected] | |
with: | |
name: NuGet package | |
path: ./nuget.package/*.nupkg |