diff --git a/.ci-scripts/x86-64-unknown-freebsd12.1-nightly.bash b/.ci-scripts/x86-64-unknown-freebsd12.1-nightly.bash new file mode 100644 index 0000000000..af07d542fe --- /dev/null +++ b/.ci-scripts/x86-64-unknown-freebsd12.1-nightly.bash @@ -0,0 +1,61 @@ +#!/bin/bash + +set -e + +API_KEY=$1 +if [[ ${API_KEY} == "" ]] +then + echo "API_KEY needs to be supplied as first script argument." + exit 1 +fi + +TODAY=$(date +%Y%m%d) + +# Compiler target parameters +ARCH=x86-64 +PIC=true + +# Triple construction +VENDOR=unkown +OS=freebsd12.1 +TRIPLE=${ARCH}-${VENDOR}-${OS} + +# Build parameters +MAKE_PARALLELISM=8 +BUILD_PREFIX=$(mktemp -d) +DESTINATION=${BUILD_PREFIX}/lib/pony +PONY_VERSION="nightly-${TODAY}" + +# Asset information +PACKAGE_DIR=$(mktemp -d) +PACKAGE=ponyc-${TRIPLE} + +# Cloudsmith configuration +CLOUDSMITH_VERSION=${TODAY} +ASSET_OWNER=ponylang +ASSET_REPO=nightlies +ASSET_PATH=${ASSET_OWNER}/${ASSET_REPO} +ASSET_FILE=${PACKAGE_DIR}/${PACKAGE}.tar.gz +ASSET_SUMMARY="Pony compiler" +ASSET_DESCRIPTION="https://github.com/ponylang/ponyc" + +# Build pony installation +echo "Building ponyc installation..." +gmake configure arch=${ARCH} build_flags=-j${MAKE_PARALLELISM} \ + version="${PONY_VERSION}" +gmake build arch=${ARCH} build_flags=-j${MAKE_PARALLELISM} \ + version="${PONY_VERSION}" +gmake install prefix=${BUILD_PREFIX} symlink=no arch=${ARCH} \ + build_flags=-j${MAKE_PARALLELISM} version="${PONY_VERSION}" + +# Package it all up +echo "Creating .tar.gz of ponyc installation..." +pushd ${DESTINATION} || exit 1 +tar -cvzf ${ASSET_FILE} * +popd || exit 1 + +# Ship it off to cloudsmith +echo "Uploading package to cloudsmith..." +cloudsmith push raw --version "${CLOUDSMITH_VERSION}" --api-key ${API_KEY} \ + --summary "${ASSET_SUMMARY}" --description "${ASSET_DESCRIPTION}" \ + ${ASSET_PATH} ${ASSET_FILE} diff --git a/.cirrus.yml b/.cirrus.yml index 0052b814c4..c81f7342bd 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -44,6 +44,34 @@ task: nightly_script: - bash .ci-scripts/x86-64-unknown-linux-musl-nightly.bash ${CLOUDSMITH_API_KEY} +task: + only_if: $CIRRUS_CRON == "master-midnight" + + freebsd_instance: + image: freebsd-12-1-release-amd64 + cpu: 8 + memory: 24 + + name: "nightly: x86-64-unknown-freebsd12.1" + + environment: + CLOUDSMITH_API_KEY: ENCRYPTED[!2cb1e71c189cabf043ac3a9030b3c7708f9c4c983c86d07372ae58ad246a07c54e40810d038d31c3cf3ed8888350caca!] + + install_script: + - echo "FETCH_RETRY = 6" >> /usr/local/etc/pkg.conf + - echo "IGNORE_OSVERSION = yes" >> /usr/local/etc/pkg.conf + - pkg update + - pkg install -y bash cmake gmake libunwind git py37-pip + - pip install --upgrade cloudsmith-cli + + libs_cache: + folder: build/libs + fingerprint_script: echo "`md5 lib/CMakeLists.txt` freebsd12.1" + populate_script: gmake libs arch=x86-64 build_flags=-j8 + + nightly_script: + - bash .ci-scripts/x86-64-unknown-freebsd12.1-nightly.bash ${CLOUDSMITH_API_KEY} + task: only_if: $CIRRUS_CRON == "master-midnight"