-
Notifications
You must be signed in to change notification settings - Fork 4
114 lines (100 loc) · 3.29 KB
/
release.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release
on:
push:
tags: ["v*.*.*"]
jobs:
lint-python:
name: Run Python lint
uses: kuba2k2/kuba2k2/.github/workflows/lint-python.yml@master
publish-pypi:
name: Publish PyPI package
runs-on: ubuntu-latest
needs:
- lint-python
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout LT repository
uses: actions/checkout@v3
with:
repository: kuba2k2/libretiny
path: libretiny
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install poetry
uses: Gr1N/setup-poetry@v8
- name: Copy LT data snapshot
run: |
mkdir -p ltchiptool/boards/_base
cp libretiny/platform.json ltchiptool/
cp libretiny/families.json ltchiptool/
cp libretiny/boards/*.json ltchiptool/boards/
cp -r libretiny/boards/_base/ ltchiptool/boards/
- name: Build package
run: poetry build
- name: Publish to PyPI
run: poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
gui-win32:
name: Build Win32 GUI release
runs-on: windows-latest
needs:
- lint-python
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout LT repository
uses: actions/checkout@v3
with:
repository: kuba2k2/libretiny
path: libretiny
- name: Set up Python Custom
# Configure embedded Python 3.10 modified to work on Windows 7
shell: cmd
run: |
mkdir python
pushd python
certutil -urlcache -split -f https://github.com/kuba2k2/cpython/releases/download/v3.10.0-win7/python-3.10.0-embed-amd64-win7.zip python.zip || exit /b
tar -xf python.zip || exit /b
certutil -urlcache -split -f https://bootstrap.pypa.io/get-pip.py get-pip.py || exit /b
python get-pip.py || exit /b
pushd Lib
tar -xf ..\python310.zip || exit /b
popd
echo .>python310._pth
echo Lib>>python310._pth
echo import site>>python310._pth
set PATH=%cd%\Scripts;%cd%;%PATH%
popd
pip install poetry || exit /b
pip install .[gui] || exit /b
move python\python310._pth python\python310._pth_
pip install pyinstaller || exit /b
move python\python310._pth_ python\python310._pth
- name: Copy LT data snapshot
shell: cmd
run: |
mkdir ltchiptool\boards\_base
copy libretiny\platform.json ltchiptool\
copy libretiny\families.json ltchiptool\
copy libretiny\boards\*.json ltchiptool\boards\
xcopy /S libretiny\boards\_base ltchiptool\boards\
- name: Install ltchiptool plugins
shell: cmd
run: |
set PATH=%cd%\python;%PATH%
python -m pip install "ltchiptool-terminal>=1.4.0" || exit /b
python -m pip install "upk2esphome>=1.10.0" || exit /b
- name: Build GUI with PyInstaller
shell: cmd
run: |
set PATH=%cd%\python;%PATH%
python gui-win32.py || exit /b
- name: Add GitHub release assets
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.exe