| 1 |
#! /usr/bin/env bash |
| 2 |
# |
| 3 |
# run as part of CI, see gem-install.yml |
| 4 |
# |
| 5 |
if [[ $# -lt 2 ]] ; then |
| 6 |
echo "usage: $(basename $0) <output_dir> <platform>" |
| 7 |
exit 1 |
| 8 |
fi |
| 9 |
|
| 10 |
set -e |
| 11 |
|
| 12 |
OUTPUT_DIR=$1 |
| 13 |
BUILD_NATIVE_GEM=$2 |
| 14 |
|
| 15 |
test -e /etc/os-release && cat /etc/os-release |
| 16 |
|
| 17 |
set -u -x |
| 18 |
|
| 19 |
# avoid the pernicious "fatal: detected dubious ownership in repository" errors |
| 20 |
git config --global --add safe.directory $(realpath $(dirname $0)/..) |
| 21 |
|
| 22 |
bundle |
| 23 |
|
| 24 |
bundle exec rake set-version-to-timestamp |
| 25 |
|
| 26 |
if [[ "${BUILD_NATIVE_GEM}" == "ruby" ]] ; then |
| 27 |
# TODO we're only compiling so that we retrieve libxml2/libxslt tarballs, we can do better. |
| 28 |
bundle exec rake clean compile |
| 29 |
bundle exec rake gem |
| 30 |
elif [[ "${BUILD_NATIVE_GEM}" == "java" ]] ; then |
| 31 |
bundle exec rake java gem |
| 32 |
else |
| 33 |
bundle exec rake gem:${BUILD_NATIVE_GEM}:builder |
| 34 |
fi |
| 35 |
|
| 36 |
chmod -v 664 ports/archives/* || true |
| 37 |
|
| 38 |
./scripts/test-gem-file-contents pkg/nokogiri*.gem |
| 39 |
|
| 40 |
mkdir -p ${OUTPUT_DIR} |
| 41 |
cp -v pkg/nokogiri*.gem ${OUTPUT_DIR} |
| 42 |
ls -l ${OUTPUT_DIR}/* |