Skip to content

Yeet.

Yeet. #76

Workflow file for this run

name: MetaCall Brew PKG Test
on:
workflow_dispatch:
pull_request:
push:
tags:
- 'v*.*.*'
branches:
- master
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Test Distributable
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14] # TODO: Add macos-12
runs-on: ${{ matrix.os }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# Clean up previous dependencies in order to avoid conflicts with brew
- name: Uninstall brew completely
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
- name: Install brew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew uninstall --force --ignore-dependencies node
brew cleanup -s node
brew cleanup --prune-prefix
brew uninstall --force --ignore-dependencies [email protected]
brew cleanup -s [email protected]
brew cleanup --prune-prefix
brew uninstall --force --ignore-dependencies [email protected]
brew cleanup -s [email protected]
brew cleanup --prune-prefix
sudo rm -rf /System/Library/Frameworks/Python.framework/
brew cleanup --prune-prefix
sudo rm -rf /usr/local/bin/2to3
sudo rm -rf /usr/local/bin/2to3-3.11
sudo rm -rf /usr/local/bin/2to3-3.12
sudo rm -rf /usr/local/bin/idle3
sudo rm -rf /usr/local/bin/idle3.11
sudo rm -rf /usr/local/bin/idle3.12
sudo rm -rf /usr/local/bin/pydoc3
sudo rm -rf /usr/local/bin/pydoc3.11
sudo rm -rf /usr/local/bin/pydoc3.12
sudo rm -rf /usr/local/bin/python3
sudo rm -rf /usr/local/bin/python3-config
sudo rm -rf /usr/local/bin/python3.11
sudo rm -rf /usr/local/bin/python3.12
sudo rm -rf /usr/local/bin/python3.11-config
sudo rm -rf /usr/local/bin/python3.12-config
brew uninstall --force --ignore-dependencies ruby
brew cleanup -s ruby
brew cleanup --prune-prefix
sudo rm -rf $(brew --repo homebrew/core)
- name: Test
run: ./test.sh
- name: Create the distributable folder
run: |
mkdir -p distributable
mv ruby-with-python.pkg distributable/
mv ruby-with-python.tgz distributable/
# Upload build artifact
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: metacall-tarball-${{ matrix.os }}
path: distributable/*
tgz-test:
name: Run Test Distributable TGZ (relocatable)
needs: build
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14] # TODO: Add macos-12
runs-on: ${{ matrix.os }}
steps:
# Clean up previous dependencies in order to avoid conflicts with brew
- name: Uninstall brew completely
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
- name: Download the artifact
uses: actions/download-artifact@v4
with:
name: metacall-tarball-${{ matrix.os }}
# Test the package in a clean environment
- name: Test
run: |
mkdir distributable
tar -xvzf ruby-with-python.tgz -C `pwd`/distributable
DARWIN_VERSION=$(sw_vers -productVersion | cut -d '.' -f 1)
if [ "$(uname -m)" = "arm64" ]; then
INSTALL_DIR="`pwd`/distributable/opt/homebrew"
RUBY_PLATFORM_PAIR="arm64-darwin${DARWIN_VERSION}"
else
INSTALL_DIR="`pwd`/distributable/usr/local"
RUBY_PLATFORM_PAIR="x86_64-darwin${DARWIN_VERSION}"
fi
export PATH="${INSTALL_DIR}/bin:$PATH"
export RUBYLIB="${INSTALL_DIR}/lib/ruby/3.3.0:${INSTALL_DIR}/lib/ruby/3.3.0/${RUBY_PLATFORM_PAIR}"
otool -L ${INSTALL_DIR}/bin/python3
otool -L ${INSTALL_DIR}/Cellar/[email protected]/3.12.5/Frameworks/Python.framework/Versions/3.12/Python || true
otool -L ${INSTALL_DIR}/bin/ruby
${INSTALL_DIR}/bin/python3 -c 'import sys; print(sys.argv)'
${INSTALL_DIR}/bin/ruby -e "require 'date'; puts Date.today"
pkg-test:
name: Run Test Distributable PKG
needs: build
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14] # TODO: Add macos-12
runs-on: ${{ matrix.os }}
steps:
# Clean up previous dependencies in order to avoid conflicts with brew
- name: Uninstall brew completely
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
- name: Download the artifact
uses: actions/download-artifact@v4
with:
name: metacall-tarball-${{ matrix.os }}
# Test the package in a clean environment
- name: Test
run: |
mkdir distributable
lsbom $(pkgutil --bom ruby-with-python.pkg)
sudo installer -pkg "ruby-with-python.pkg" -target /
if [ "$(uname -m)" = "arm64" ]; then
INSTALL_DIR="/opt/homebrew"
else
INSTALL_DIR="/usr/local"
fi
otool -L ${INSTALL_DIR}/bin/python3
otool -L ${INSTALL_DIR}/bin/ruby
${INSTALL_DIR}/bin/python3 -c 'import sys; print(sys.argv)'
${INSTALL_DIR}/bin/ruby -e "require 'date'; puts Date.today"