Skip to content

Commit

Permalink
Add macOS prebuilt releases via Cloudsmith (ponylang#3433)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanTAllen authored Dec 24, 2019
1 parent 3ab87cc commit b099fe9
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .ci-scripts/x86-64-apple-darwin-release.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/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


# Compiler target parameters
ARCH=x86-64
PIC=true

# Triple construction
VENDOR=apple
OS=darwin
TRIPLE=${ARCH}-${VENDOR}-${OS}

# Build parameters
MAKE_PARALLELISM=8
BUILD_PREFIX=$(mktemp -d)
DESTINATION=${BUILD_PREFIX}/lib/pony

# Asset information
PACKAGE_DIR=$(mktemp -d)
PACKAGE=ponyc-${TRIPLE}

# Cloudsmith configuration
CLOUDSMITH_VERSION=${cat VERSION}
ASSET_OWNER=ponylang
ASSET_REPO=releases
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..."
make install prefix=${BUILD_PREFIX} default_pic=${PIC} arch=${ARCH} \
-j${MAKE_PARALLELISM} -f Makefile-lib-llvm symlink=no

# 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}
18 changes: 18 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@ task:
release_script:
- bash .ci-scripts/x86-64-unknown-linux-musl-release.bash ${CLOUDSMITH_API_KEY}

task:
only_if: $CIRRUS_TAG =~ '^\d+\.\d+\.\d+$'

osx_instance:
image: mojave-xcode-11.2.1

name: "release: x86-64-apple-darwin"

environment:
CLOUDSMITH_API_KEY: ENCRYPTED[!2cb1e71c189cabf043ac3a9030b3c7708f9c4c983c86d07372ae58ad246a07c54e40810d038d31c3cf3ed8888350caca!]

install_script:
- brew install coreutils python
- pip3 install --upgrade cloudsmith-cli

nightly_script:
- bash .ci-scripts/x86-64-apple-darwin-release.bash ${CLOUDSMITH_API_KEY}

#
# Pull Request Tasks
#
Expand Down

0 comments on commit b099fe9

Please sign in to comment.