Skip to content

Commit

Permalink
Include target packages in maven artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Jul 18, 2023
1 parent aed2274 commit 7c43c0a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 34 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ jobs:
with:
python-version: ${{ steps.python-versions.outputs.short }}

# TODO: build these in CI as well
- name: Download target Python builds
# This step uses a self-contained script rather than steps.python-versions,
# because it's referenced from product/README.md.
- name: Download Android Python builds
run: |
cd target
echo "${{ steps.python-versions.outputs.long }}" | while read version; do
./download-and-unpackage.sh prefix $version
for version in $(./list-versions.py --long); do
target_dir=../maven/com/chaquo/python/target/$version
./download-target.sh $target_dir
./unpackage-target.sh prefix $target_dir
done
- name: Install Python requirements
Expand Down
7 changes: 1 addition & 6 deletions product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ This file contains instructions for building and testing Chaquopy.
Unix, or `py -X.Y` on Windows.

* Android Python headers and libraries in target/prefix. These can be installed as
follows:

cd target
for version in $(./list-versions.py --long); do
./download-and-unpackage.sh prefix $version
done
shown in ci.yml.

* Python requirements from runtime/requirements-build.txt. In particular, `cython` must be
on the PATH.
Expand Down
23 changes: 0 additions & 23 deletions target/download-and-unpackage.sh

This file was deleted.

20 changes: 20 additions & 0 deletions target/download-target.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -eu

# Positional arguments:
# * Maven directory to download into, e.g. /path/to/com/chaquo/python/target/3.10.6-3.
# Must not already exist.

# Fail if target already exists: we don't want to overwrite things by accident.
mkdir -p $(dirname ${1:?})
mkdir $1
target_dir=$(cd $1 && pwd)

cd $target_dir
version=$(basename $target_dir)

# Set user-agent to circumvent Maven Central's block of wget.
# Redirect stderr to stdout, otherwise output gets mixed up in CI.
wget -r -l1 --no-parent --no-directories --accept .zip --progress dot:giga \
-e robots=off --user-agent Mozilla/5.0 \
https://repo.maven.apache.org/maven2/com/chaquo/python/target/$version/ 2>&1
1 change: 0 additions & 1 deletion target/unpackage-target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ set -eu
# Positional arguments (order is the same as package-target.sh):
# * `prefix` directory to unpack into.
# * Maven directory to unpack from, e.g. /path/to/com/chaquo/python/target/3.10.6-3.
# Must end in a version number.

mkdir -p "${1:?}"
prefix_dir=$(cd ${1:?} && pwd)
Expand Down

0 comments on commit 7c43c0a

Please sign in to comment.