Skip to content

Commit

Permalink
Add nightly FreeBSD 12.1 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanTAllen committed Apr 18, 2020
1 parent 91ecfb2 commit 71bd8b0
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .ci-scripts/x86-64-unknown-freebsd12.1-nightly.bash
Original file line number Diff line number Diff line change
@@ -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}
28 changes: 28 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 71bd8b0

Please sign in to comment.