-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (72 loc) · 2.86 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
on:
push:
tags:
- release.**
env:
PYTHON_VERSION: "3.9"
POETRY_VERSION: "1.8.1"
POETRY_URL: https://install.python-poetry.org
NUITKA_CACHE_DIR: ~/.nuitka/cache
defaults:
run:
shell: bash
jobs:
build:
strategy:
matrix:
# Do not use the latest versions in order to be backward compatible.
# In particular, macos 14+ will build for arm only.
os: [macos-12, ubuntu-20.04, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-pip-wheels
uses: actions/cache@v3
with:
path: ~/.cache
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
# Modified rom https://github.com/Nuitka/Nuitka-Action/blob/main/action.yml
# We cannot use that github action in full because it assumes a lot that isn't true (e.g. PYTHON_VERSION not set,
# requirements.txt used, etc.).
- name: Install ccache
# TODO: Proper "in" test could make sense here.
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
sudo apt-get install -y ccache
- name: Cache Nuitka cache directory
uses: actions/cache@v4
with:
path: ${{ env.NUITKA_CACHE_DIR }}
key: ${{ runner.os }}-python-${{ env.PYTHON_VERSION }}-nuitka-${{ github.sha }}
restore-keys: |
${{ runner.os }}-python-${{ env.PYTHON_VERSION }}-
${{ runner.os }}-python-
${{ runner.os }}-
- name: Build Executable
run: |
source $VENV
python -m nuitka --output-dir=build --assume-yes-for-downloads --onefile --macos-create-app-bundle --include-package=dash --include-package-data=dash --include-package=dash_core_components --include-package-data=dash_core_components --include-package=dash_html_components --include-package-data=dash_html_components --include-package=packaging --include-package-data=packaging --include-package=plotly --include-package-data=plotly --include-package=ecgviewer --include-package-data=ecgviewer src/ecgviewer/main.py
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }} Build
path: |
build/*.exe
build/*.bin
build/*.app/**/*