Skip to content

Commit

Permalink
Create CI workflow with build-product job
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Jul 16, 2023
1 parent ef769d8 commit 0248a57
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
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
1 change: 0 additions & 1 deletion target/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/prefix
*/build
2 changes: 2 additions & 0 deletions target/prefix/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 0248a57

Please sign in to comment.