Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prebuilt ponyc releases on MacOS for Apple Silicon #4119

Merged
merged 1 commit into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .ci-scripts/arm64-release.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

set -e

# Verify ENV is set up correctly
# We validate all that need to be set in case, in an absolute emergency,
# we need to run this by hand. Otherwise the CI environment should
# provide all of these if properly configured
if [[ -z "${CLOUDSMITH_API_KEY}" ]]; then
echo -e "\e[31mCloudsmith API key needs to be set in CLOUDSMITH_API_KEY."
echo -e "Exiting.\e[0m"
exit 1
fi

if [[ -z "${TRIPLE_VENDOR}" ]]; then
echo -e "\e[31mVendor needs to be set in TRIPLE_VENDOR."
echo -e "Exiting.\e[0m"
exit 1
fi

if [[ -z "${TRIPLE_OS}" ]]; then
echo -e "\e[31mOperating system needs to be set in TRIPLE_OS."
echo -e "Exiting.\e[0m"
exit 1
fi

# Compiler target parameters
MACHINE=arm64
PROCESSOR=armv8

# Triple construction
TRIPLE=${MACHINE}-${TRIPLE_VENDOR}-${TRIPLE_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 configure arch=${PROCESSOR} build_flags=-j${MAKE_PARALLELISM}
make build
make install arch=${PROCESSOR} prefix="${BUILD_PREFIX}" 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 "${CLOUDSMITH_API_KEY}" --summary "${ASSET_SUMMARY}" \
--description "${ASSET_DESCRIPTION}" ${ASSET_PATH} "${ASSET_FILE}"
30 changes: 30 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,36 @@ task:
- export TZ=utc
- bash .ci-scripts/x86-64-release.bash

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

timeout_in: 120m

macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:13.3.1

name: "release: arm64-apple-darwin"

environment:
TRIPLE_VENDOR: apple
TRIPLE_OS: darwin
CLOUDSMITH_API_KEY: ENCRYPTED[!2cb1e71c189cabf043ac3a9030b3c7708f9c4c983c86d07372ae58ad246a07c54e40810d038d31c3cf3ed8888350caca!]

libs_cache:
folder: build/libs
fingerprint_script: echo "`md5 lib/CMakeLists.txt` arm64 ghcr.io/cirruslabs/macos-monterey-xcode:13.3.1 20220511"
populate_script: make libs build_flags=-j12
upload_caches:
- libs

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

nightly_script:
- export TZ=utc
- bash .ci-scripts/arm64-release.bash

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

Expand Down
3 changes: 3 additions & 0 deletions .release-notes/apple-silicon-mac-os-releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Add prebuilt ponyc binaries for MacOS on Apple Silicon

We've added prebuilt ponyc binaries specifically made to work MacOS Monterey on Apple Silicon. They can be downloaded directly from Cloudsmith. ponyup installation support will be coming in the near future.
1 change: 1 addition & 0 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ You can verify that the release artifacts were successfully built and uploaded b

Package names will be:

* ponyc-arm64-apple-darwin.tar.gz
* ponyc-x86-64-apple-darwin.tar.gz
* ponyc-x86-64-unknown-freebsd-13.0.tar.gz
* ponyc-x86-64-pc-windows-msvc.zip
Expand Down