Skip to content

Feature/python version upgrades (#2030) #1315

Feature/python version upgrades (#2030)

Feature/python version upgrades (#2030) #1315

name: Pyinstaller (on_push)
on:
push:
paths:
- .github/scripts/cicd/build_pyinstaller.sh
- .github/workflows/on-push-pyinstaller.yml
- runway/*
- poetry.lock
- pyproject.toml
- runway.file.spec
- runway.folder.spec
env:
AWS_DEFAULT_REGION: us-east-1
jobs:
build-pyinstaller-onefile:
name: Pyinstaller "One File" Build
strategy:
matrix:
os: [macos-12, ubuntu-latest, windows-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
env:
OS_NAME: ${{ matrix.os }}
# pydantic binary causes a recursion error
# https://github.com/pyinstaller/pyinstaller/issues/4406
PIP_NO_BINARY: pydantic
steps:
- name: Checkout Repo (complete)
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
- name: Install Dependencies (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: sudo apt-get update && sudo apt-get install sed -y
- name: Install Dependencies (windows)
if: matrix.os == 'windows-latest'
run: choco install make sed
- uses: Gr1N/setup-poetry@v8
- uses: actions/[email protected]
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- name: Run Build
run: make build-pyinstaller-file
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: pyinstaller-onefile-${{ matrix.os }}
path: artifacts
build-pyinstaller-onefolder:
name: Pyinstaller "One Folder" Build
strategy:
matrix:
os: [macos-12, ubuntu-latest, windows-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
env:
OS_NAME: ${{ matrix.os }}
# pydantic binary causes a recursion error
# https://github.com/pyinstaller/pyinstaller/issues/4406
PIP_NO_BINARY: pydantic
steps:
- name: Checkout Repo (complete)
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
- name: Install Dependencies (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: sudo apt-get update && sudo apt-get install sed -y
- name: Install Dependencies (windows)
if: matrix.os == 'windows-latest'
run: choco install make sed
- uses: Gr1N/setup-poetry@v8
- uses: actions/[email protected]
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- name: Run Build
run: make build-pyinstaller-folder
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: pyinstaller-onefolder-${{ matrix.os }}
path: artifacts
build-npm:
name: Build npm 📦
if: github.ref == 'refs/heads/master'
needs:
- build-pyinstaller-onefolder
env:
NODE_VERSION: 12
NPM_PACKAGE_NAME: '@onica/runway'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo (complete)
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: check_distance
name: Ensure Commit Is Not Tagged
continue-on-error: true
run: bash ./check_distance_from_tag.sh
working-directory: .github/scripts/cicd
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-node@v4
if: steps.check_distance.outcome == 'success'
with:
always-auth: true
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
scope: '@onica'
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
- name: Install Dependencies (ubuntu)
if: steps.check_distance.outcome == 'success'
run: sudo apt-get update && sudo apt-get install sed tree -y
- uses: Gr1N/setup-poetry@v8
- uses: actions/[email protected]
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- name: Download Artifacts (macOS)
if: steps.check_distance.outcome == 'success'
uses: actions/download-artifact@v3
with:
name: pyinstaller-onefolder-macos-12
path: artifacts
- name: Download Artifacts (ubuntu)
if: steps.check_distance.outcome == 'success'
uses: actions/download-artifact@v3
with:
name: pyinstaller-onefolder-ubuntu-22.04
path: artifacts
- name: Download Artifacts (windows)
if: steps.check_distance.outcome == 'success'
uses: actions/download-artifact@v3
with:
name: pyinstaller-onefolder-windows-latest
path: artifacts
- name: List Artifacts
if: steps.check_distance.outcome == 'success'
run: tree artifacts/
- name: npm Prep
if: steps.check_distance.outcome == 'success'
run: make npm-prep
- name: npm pack
if: steps.check_distance.outcome == 'success'
run: |
npm pack
rm -rf artifacts && mkdir -p artifacts
find . -name 'onica-runway-*.*.*.tgz' -exec mv {} artifacts/ \;
- name: Skipped Publishing
if: steps.check_distance.outcome == 'failure'
run: echo "A pre-production version was not published because the current commit is tagged for release."
- name: Upload Artifacts
if: steps.check_distance.outcome == 'success'
uses: actions/upload-artifact@v3
with:
name: npm-pack
path: artifacts