-
Notifications
You must be signed in to change notification settings - Fork 6
90 lines (88 loc) · 3.05 KB
/
toolbox-flextool-bundle.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
85
86
87
88
89
90
name: Make Bundle for Toolbox and FlexTool
on:
workflow_dispatch:
inputs:
git-ref:
description: "Git branch, tag or SHA to bundle."
required: true
type: string
default: ""
jobs:
bundle:
name: Bundle
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.git-ref }}
fetch-depth: 0
repository: spine-tools/Spine-Toolbox
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install numpy # See issue #2852. Remove when PyInstaller supports numpy 2.0+
python -m pip install -r requirements.txt
- name: Install PyInstaller
run: |
python -m pip install PyInstaller
- name: List packages
run:
python -m pip list
- name: Download embeddable Python
run: |
mkdir embedded-python
cd embedded-python
curl -o python.zip https://www.python.org/ftp/python/3.12.7/python-3.12.7-embed-amd64.zip
tar xf python.zip
del python.zip
- name: Edit embedded Python search paths
run: |
cd embedded-python
Add-Content ./*._pth "Lib"
Add-Content ./*._pth "Lib/site-packages"
cat ./*._pth
- name: Download get-pip.py
run: |
cd embedded-python
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- name: Install pip for embedded Python
run : |
cd embedded-python
./python.exe get-pip.py
- name: List packages in embedded Python
run: |
cd embedded-python/Scripts
./pip.exe list
- name: Build bundle
run: |
python -m PyInstaller spinetoolbox.spec -- --embedded-python=embedded-python
- name: Get Toolbox version
id: toolbox-version
shell: bash
run: |
python -c "from importlib.metadata import version; print('version=' + version('spinetoolbox'))" >> $GITHUB_OUTPUT
- name: Install FlexTool
run: |
cd "dist/Spine Toolbox"
git clone -b structural_update --single-branch https://github.com/irena-flextool/flextool.git --depth=1
../../embedded-python/python -m pip install pandas
../../embedded-python/python -m pip install spinedb-api
cd flextool
../../../embedded-python/python update_flextool.py --skip-git
# cd flextool
# ../../../embedded-python/python -m pip install -r requirements.txt
- name: Upload archive with artifact v4
uses: actions/upload-artifact@v4
with:
name: FlexTool-Toolbox-win-${{ steps.toolbox-version.outputs.version }}
path: "./dist/Spine Toolbox"
if-no-files-found: error
include-hidden-files: true