Skip to content

Commit

Permalink
build(PYENV): pin version
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed Jan 29, 2023
1 parent d442e80 commit 2f0a87e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,16 @@ jobs:
if: contains(github.ref, '/tags/v') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/production'
shell: bash -l {0}
run: |
eval $(pyenv init --path)
eval $(~/.pyenv/bin/pyenv init --path)
pip install poetry wheel
poetry install
env:
PYENV_VERSION: ${{ matrix.python-version }}

- name: OSX Build -- Build Mac Maker Binary
if: contains(github.ref, '/tags/v') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/production'
shell: bash -l {0}
run: |
eval $(pyenv init --path)
eval $(~/.pyenv/bin/pyenv init --path)
./scripts/build.sh binary "${OS_VERSION}" "${BRANCH_OR_TAG}"
env:
PYENV_VERSION: ${{ matrix.python-version }}
Expand All @@ -126,7 +125,6 @@ jobs:
if: contains(github.ref, '/tags/v') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/production'
shell: bash -l {0}
run: |
eval $(pyenv init --path)
./dist/mac_maker version
env:
PYENV_VERSION: ${{ matrix.python-version }}
Expand Down
22 changes: 15 additions & 7 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

set -e

PYENV_VERSION_TAG="v2.3.10"

wrong_platform(){
echo "This script needs to be run on an OSX machine."
exit 127
}

wrong_args(){
echo "Usages: "
echo "./scripts/build pyenv [version (3.8.10)]"
echo "./scripts/build binary [version (10.14)]"
echo "./scripts/build pyenv [Python Version (3.8.10)]"
echo "./scripts/build binary [OS Version (10.14)] [Mac Maker Version (0.0.5)]"
exit 127
}

build_binary() {

poetry build
poetry run pip install ./dist/mac_maker-*-py3-none-any.whl
poetry install --only=main
poetry run pyinstaller build.spec

pushd dist || exit 127
Expand All @@ -29,14 +30,21 @@ build_binary() {
tar cvzf "${BASE_NAME}.tar.gz" "${BASE_NAME}"
rm -rf "${BASE_NAME}"
popd || true

}

build_python() {

brew install pyenv coreutils openssl readline sqlite3 xz zlib
env HOMEBREW_NO_AUTO_UPDATE=1 brew install coreutils openssl readline sqlite3 xz zlib
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
pushd ~/.pyenv
git checkout "${PYENV_VERSION_TAG}"
src/configure
make -C src
popd

env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install "${2}"
pyenv local "${2}"
env PYTHON_CONFIGURE_OPTS="--enable-framework" ~/.pyenv/bin/pyenv install "${2}"
~/.pyenv/bin/pyenv local "${2}"

}

Expand Down

0 comments on commit 2f0a87e

Please sign in to comment.