Skip to content

Commit

Permalink
chore: setup packaging as part of CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kennedykori committed Jul 21, 2022
1 parent 5ded373 commit 107c250
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/dev.txt
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox -r
env:
# use localhost for the host here because we are running the job on the
# Use localhost for the host here because we are running the job on the
# VM. If we were running the job on in a container this would be mysql.
MYSQL_TEST_DB_HOST: localhost
MYSQL_TEST_DB_PORT: ${{ job.services.mysql.ports[3306] }} # get randomly assigned published port
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release

on: [push]

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install requirements
run: |
sudo apt-get update
sudo apt-get install python3.10
pip install -r requirements/base.txt pyinstaller~=5.2 staticx~=0.13.6
- name: Package the app
run: |
pyinstaller app/__main__.py --hidden-import apps/imp --collect-all app --name idr_client_temp -F
staticx dist/idr_client_temp {envdir}{/}idr_client
3 changes: 1 addition & 2 deletions app/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Any, Optional, Sequence

import app
from app.__version__ import __title__, __version__
from app.core import DataSourceType, Transport
from app.lib import Pipeline
from app.use_cases.main_pipeline import (
Expand All @@ -10,8 +11,6 @@
UploadExtracts,
)

from .__version__ import __title__, __version__

# =============================================================================
# HELPERS
# =============================================================================
Expand Down
4 changes: 3 additions & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-r test.txt

pre-commit~=2.19.0
pre-commit~=2.20.0
pyinstaller~=5.2
staticx~=0.13.6
14 changes: 13 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = {py37, py38, py39, py310}, coveralls
envlist = {py37, py38, py39, py310}, coveralls, package
isolated_build = true
minversion = 3.10
skip_missing_interpreters = true
Expand Down Expand Up @@ -53,3 +53,15 @@ passenv =
MYSQL_TEST_DB_PASSWORD
MYSQL_TEST_DB_PORT
MYSQL_TEST_DB_USERNAME


[testenv:package]
basepython = python3.10
commands =
pyinstaller app/__main__.py --hidden-import apps/imp --collect-all app --name idr_client_temp -F
staticx dist/idr_client_temp {envdir}{/}idr_client
{envdir}{/}idr_client --version
deps =
-r{toxinidir}{/}requirements{/}base.txt
pyinstaller~=5.2
staticx~=0.13.6

0 comments on commit 107c250

Please sign in to comment.