-
-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91ecfb2
commit 71bd8b0
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters