PKG: try excluding /usr/lib/libffi.dylib #3
Workflow file for this run
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
name: build | |
on: | |
workflow_dispatch: # manual | |
pull_request: | |
branches: [ build-standalone ] | |
schedule: | |
- cron: '0 0 * * 5' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, windows-latest] | |
indygreg-release: ["20230507"] # see https://github.com/indygreg/python-build-standalone/releases | |
python-version: ["3.10.11"] | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python ${{ matrix.python-version }} on MacOS | |
uses: actions/setup-python@v4 | |
if: runner.os == 'macOS' | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Check PsychoPy version name | |
run: | | |
PSYCHOPY_VER=$(cat version | tr -d '\n') | |
- name: Install MacOS depends (Homebrew) | |
if: runner.os == 'macOS' | |
run: | | |
brew update --preinstall | |
brew install glfw lame libevent | |
brew install labstreaminglayer/tap/lsl | |
- name: Unpack portable Python distro (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
# e.g. https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11+20230507-aarch64-apple-darwin-pgo-full.tar.zst | |
echo "Building on ${{ runner.os }}" | |
if [ "${{ runner.os }}" == "Windows" ] | |
then | |
arch="x86_64-pc-windows-msvc-shared" | |
shasum=sha256sum | |
elif [ "${{ runner.os }}" == "Linux" ] | |
then | |
arch="x86_64-unknown-linux" | |
elif [ "${{ runner.os }}" == "macOS" ] | |
then | |
arch="x86_64-apple-darwin" | |
else | |
echo "unknown OS ${{ runner.os }}" | |
fi | |
fname="cpython-${{ matrix.python-version }}+${{ matrix.indygreg-release }}-$arch-install_only.tar.gz" | |
indygreg="https://github.com/indygreg/python-build-standalone/releases/download/${{ matrix.indygreg-release }}" | |
url="$indygreg/$fname" | |
echo $url | |
# fetch the files | |
curl --location "$url" -o python.tar.gz | |
curl --location "$url.sha256" -o shafile | |
# check checksum first | |
python3 .github/workflows/checksum.py python.tar.gz shafile sha256 | |
# then unzip and move | |
tar -xf python.tar.gz | |
# move to our preferred path | |
mv python py | |
# clean up unecess files | |
rm python.tar.gz shafile | |
- name: Install dependencies | |
run: | | |
# NB pip comes in indygreg but not in python.org | |
# for python.org do .venv/bin/python get-pip.py | |
shopt -s expand_aliases # allow aliases in bash | |
if [ "${{ runner.os }}" == "Windows" ] | |
then | |
ls py/* | |
alias mypip='py/python -m pip' | |
else | |
alias mypip='python -m pip' | |
fi | |
mypip install -U pip | |
mypip install -U wheel | |
mypip install ".[building]" # install self with building extras | |
mypip install ".[tests]" # install self with tests extras | |
mypip install ".[suggested]" # install self with tests extras | |
- name: Install NSIS plugins (Windows) | |
if: runner.os == 'Windows' | |
run: | |
mkdir nsis_plugins; | |
url="https://nsis.sourceforge.io/mediawiki/images/7/7f/EnVar_plugin.zip"; | |
curl --location "$url" -o EnVar_plugin.zip; | |
unzip EnVar_plugin.zip -d nsis_plugins; | |
# cp -r nsis_plugins/Plugins "$PROGRAMFILES/NSIS"; | |
# ls -al $PROGRAMFILES/NSIS/Plugins/x86-unicode; | |
- name: Create nsis installer | |
uses: joncloud/makensis-action | |
with: | |
additional-plugin-paths: ${{ github.workspace }}/NSIS_Plugins/Plugins | |
arguments: "/V3 /DPRODUCT_VERSION='${{ env.PSYCHOPY_VER }}' /DPRODUCT_NAME='PsychoPy' /DARCH='win64' /DPYPATH='py\\'" | |
- name: Build binary (MacOS) | |
if: runner.os == 'macOS' | |
run: | |
sitepackages=$(python3 -c "import site; print(site.getsitepackages()[0])"); | |
sudo touch $sitepackages/metapensiero/__init__.py; | |
sh ./building/buildAppMacOS.sh ${{ secrets.OST_APPLE_ID }} ${{ secrets.OST_APPLE_PWORD }}; | |
- name: Upload builds with googleapi | |
env: | |
DOGFOOD_KEY: ${{ secrets.PSYCHOPY_BUILD_KEY }} | |
NIGHTLY_FOLDER: ${{ secrets.NIGHTLY_FOLDER }} | |
if: ${{ env.gdrive_key != '' }} | |
run: | | |
ls -al | |
# NB this is using python but after we build so won't include? | |
python3 -m pip install googleapi | |
if [ "${{ runner.os }}" == "Windows" ] | |
then | |
echo "uploading windows build" | |
python3 .github/workflows/gdrive.py $DOGFOOD_KEY --folder_id=$NIGHTLY_FOLDER --filepath=dist --glob_pattern='**/*.exe' --suffix='date' | |
else | |
echo "uploading macos build" | |
# python3 .github/workflows/gdrive.py $DOGFOOD_KEY --folder_id=$NIGHTLY_FOLDER --filepath=dist --glob_pattern='**/*.zip' --suffix='date' | |
python3 .github/workflows/gdrive.py $DOGFOOD_KEY --folder_id=NIGHTLY_FOLDER --filepath=dist --glob_pattern='**/*.dmg' --suffix='date' | |
fi |