Skip to content

Commit

Permalink
DEV-245 build binaries (#266)
Browse files Browse the repository at this point in the history
* DEV-245: Add github action to test and build binary

Co-authored-by: Rowland Ogwara <rogwara@uchicago.edu>
  • Loading branch information
singergr-ctds and kulgan committed Jun 26, 2020
1 parent 5f11997 commit a3b2824
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci
on:
push:
branches:
- develop
- release/**
- hotfix/**
- feat/dev-245-build-binaries
tags:
- "*"

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- ubuntu-16.04
- windows-latest
python:
- 3.7
env:
GDC_CLIENT_ZIP: "gdc-client.zip"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Run Tests
if: matrix.os != 'windows-latest'
run: |
python -m pip install --upgrade pip
pip install tox
tox -e py
- name: Package
run: |
cd bin
pip install virtualenv
. ./package
echo ::set-env name=GDC_CLIENT_ZIP::$GDC_CLIENT_ZIP
shell: bash
- uses: actions/upload-artifact@v2
with:
name: ${{ env.GDC_CLIENT_ZIP }}-py${{ matrix.python }}-${{ matrix.os }}
path: bin/gdc-client_*.zip
9 changes: 7 additions & 2 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ echo "Building for ${TARGET_ENVIRONMENT}..."
# Make sure the correct version of pyinstaller and setuptools are installed
pip install -U "PyInstaller==3.5"

# Ran into ModuleNotFoundError: No module named 'pkg_resources.py2_warn' with higher versions of setuptools
pip install --upgrade 'setuptools<45.0.0'

# Get version
VERSION=$(python -c "
import gdc_client.version
Expand All @@ -102,14 +105,16 @@ echo "Testing produced binary..."
echo "Zipping binary..."
cd dist

ZIP_NAME="gdc-client_${VERSION}_${TARGET_ENVIRONMENT}_x64.zip"
PRE_ZIP_NAME="gdc-client_${VERSION}_${TARGET_ENVIRONMENT}_x64"
if [ -n "${DATE}" ]; then
ZIP_NAME="gdc-client_${VERSION}_${DATE}_${TARGET_ENVIRONMENT}_x64.zip"
PRE_ZIP_NAME="gdc-client_${VERSION}_${DATE}_${TARGET_ENVIRONMENT}_x64"
fi

ZIP_NAME="$PRE_ZIP_NAME.zip"
echo "The output zip file will be called ${ZIP_NAME}"
compress "$ZIP_NAME" "$BINARY_NAME"
mv "$ZIP_NAME" ..
cd ..

cleanup
export GDC_CLIENT_ZIP="$PRE_ZIP_NAME"

0 comments on commit a3b2824

Please sign in to comment.