Create CI workflow with build-product job #1
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] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-product: | |
runs-on: macos-latest # The fastest runner | |
steps: | |
- uses: actions/checkout@v3.5.3 | |
# TODO: generate versions from Common.java | |
- uses: actions/setup-python@v4.6.1 | |
with: | |
python-version: | | |
3.8 | |
3.9 | |
3.10 | |
3.11 | |
- name: Install Python requirements | |
run: pip install -r product/runtime/requirements-build.txt | |
# TODO: move versions to a single location used by both CI and | |
# runtime/build.gradle. | |
- name: Set up Android SDK | |
run: "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager | |
'cmake;3.22.1' 'ndk;22.1.7171670' 'platforms;android-30'" | |
- name: Unpackage target | |
run: | | |
target_dir=$(pwd)/maven/com/chaquo/python/target | |
mkdir -p $target_dir | |
cd $target_dir | |
# TODO: generate versions from Common.java | |
for version in 3.8.16-0 3.9.13-1 3.10.6-1 3.11.0-2; do | |
mkdir $target_dir/$version | |
cd $target_dir/$version | |
target_url=https://repo.maven.apache.org/maven2/com/chaquo/python/target | |
wget -r -l1 -nd -A .zip -e robots=off -U Mozilla/5.0 $base_url/$version | |
cd $GITHUB_WORKSPACE/target | |
./unpackage-target.sh ./prefix $target_dir/$version | |
done | |
- name: Create local.properties | |
run: | | |
for version in 8 11; do | |
java_home=${!JAVA_HOME_${version}_X64} | |
echo chaquopy.java.home.$version=$java_home >> product/local.properties | |
done | |
- name: Build | |
run: | | |
cd product | |
./gradlew publish | |
- uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: maven | |
path: maven | |
if-no-files-found: error | |
# test-gradle-plugin: | |
# needs: build-product | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# os: [macos, ubuntu, windows] | |
# agp-version: ["8.0"] # TODO: generate from directory listing | |
# runs-on: ${{ matrix.os }}-latest | |
# steps: | |
# - FIXME |