[release] v4.10.0 #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |