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

Build with Python 3.7 and GitHub Actions #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build Python

on:
push:
branches:
- '*'

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
# OS info
- run: uname -a && sw_vers
# We need to ensure openSSL is available
- run: HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl
- run: brew list --versions openssl
- run: OPEN_SSL_DIR=$(brew --prefix openssl) && echo $OPEN_SSL_DIR
#- run: "$OPEN_SSL_DIR/bin/openssl" version
# Download, build Python, and upload it
- run: sh build_python.sh
- run: mkdir upload
- run: tar czf upload/python3-full.tar.gz python/
- uses: actions/upload-artifact@v1
with:
name: python3-full
path: ./upload/python3-full.tar.gz
# Check built Python
- run: du -sk python/
- run: cp ./python/bin/python3.7 ./python/bin/python3
- run: otool -L python/bin/python3
- run: ./python/bin/python3 -c 'import ssl; print(ssl.OPENSSL_VERSION)'
- run: otool -L python/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so
- run: ./python/bin/python3 -m pip --version
# Reduce built Python and upload it
- run: python process_python_build.py python/
- run: echo "Python 3.7.5" >> python/version.txt
- run: tar czf upload/python3-reduced.tar.gz python/
- uses: actions/upload-artifact@v1
with:
name: python3-reduced
path: ./upload/python3-reduced.tar.gz
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
*.swp
python/*
Python-3*/*

# OS X
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

13 changes: 8 additions & 5 deletions build_python.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/sh
set -e

alias large_echo='{ set +x; } 2> /dev/null; f(){ echo "#\n#\n# $1\n#\n#"; set -x; }; f'

PY_VER=3.7.5

large_echo "Check OpenSSL installation path and CWD"
if brew ls --versions openssl > /dev/null; then
OPENSSL_ROOT="$(brew --prefix openssl)"
Expand All @@ -13,12 +16,12 @@ fi
CURRENT_DIR="$PWD"
echo $CURRENT_DIR

large_echo "Download and uncompress Python source"
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar -zxvf Python-3.6.5.tgz &> /dev/null
large_echo "Download and uncompress Python $PY_VER source"
wget "https://www.python.org/ftp/python/$PY_VER/Python-$PY_VER.tgz"
tar -zxvf "Python-$PY_VER.tgz" &> /dev/null

cd Python-3.6.5
cd "Python-$PY_VER"
large_echo "Configure Python"
./configure MACOSX_DEPLOYMENT_TARGET=10.9 CPPFLAGS="-I$OPENSSL_ROOT/include" LDFLAGS="-L$OPENSSL_ROOT/lib" --prefix="$CURRENT_DIR/python"
./configure MACOSX_DEPLOYMENT_TARGET=10.11 CPPFLAGS="-I$OPENSSL_ROOT/include" LDFLAGS="-L$OPENSSL_ROOT/lib" --with-openssl="$OPENSSL_ROOT" --prefix="$CURRENT_DIR/python"
large_echo "Build Python"
make altinstall
2 changes: 1 addition & 1 deletion process_python_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
VERBOSE = False

# Python version is used for folder names and exec files in built output
VERSION_STR = '3.6'
VERSION_STR = '3.7'
PYTHON_VER = 'python{}'.format(VERSION_STR)

# Set the files and directories we can remove from a Python build folder
Expand Down