Merge pull request #30 from luftaquila/fix/convert-error-handle #72
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: | |
workflow_dispatch: | |
jobs: | |
image: | |
name: export KiCAD images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install KiCAD | |
run: | | |
sudo add-apt-repository ppa:kicad/kicad-8.0-releases | |
sudo apt-get update | |
sudo apt-get install -y kicad | |
- name: generate images | |
run: | | |
mkdir -p kicad | |
kicad-cli sch export svg device/hardware/TMA-1.kicad_sch -o kicad --exclude-drawing-sheet --no-background-color | |
kicad-cli pcb export svg device/hardware/TMA-1.kicad_pcb -o kicad/artwork.svg --layers "B.Cu,F.Cu,F.Silkscreen,B.Silkscreen,User.Drawings,Edge.Cuts" --exclude-drawing-sheet | |
- uses: int128/upload-artifact-wiki-action@v1 | |
id: upload-artifact-wiki-action | |
with: | |
path: kicad/*.svg | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: kicad | |
path: kicad | |
config_tool: | |
name: build TMA-1 config tool | |
runs-on: windows-latest | |
env: | |
KIVY_GL_BACKEND: 'angle_sdl2' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r builder/config/requirements.txt | |
pip install pyinstaller | |
- name: package TMA-1 config tool | |
run: | | |
pyinstaller builder/main.spec | |
- name: cleanup | |
shell: cmd | |
run: | | |
move dist\main.exe builder | |
rmdir /S /Q build dist | |
- name: read version | |
shell: bash | |
run: | | |
tag=`cat installer/version.txt` | |
echo "tag=$tag" >> $GITHUB_ENV | |
- name: zip artifacts | |
run: Compress-Archive -Path ./* -Destination monolith-${{ env.tag }}.zip | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: monolith-${{ env.tag }} | |
path: monolith-${{ env.tag }}.zip | |
installer: | |
name: build Monolith installer | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests pyinstaller | |
- name: package installer | |
run: | | |
pyinstaller installer/install.spec | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: installer | |
path: dist/install.exe | |
release: | |
name: release | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: [config_tool, installer] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: read version | |
shell: bash | |
run: | | |
tag=`cat installer/version.txt` | |
echo "tag=$tag" >> $GITHUB_ENV | |
- uses: actions/download-artifact@v4 | |
- run: mv installer/install.exe monolith-installer-${{ env.tag }}.exe | |
- uses: ncipollo/release-action@v1 | |
with: | |
skipIfReleaseExists: true | |
artifacts: "monolith-installer-${{ env.tag }}.exe,monolith-${{ env.tag }}/monolith-${{ env.tag }}.zip" | |
tag: ${{ env.tag }} | |
commit: ${{ github.sha }} | |
body: "[monolith-installer-${{ env.tag }}.exe](https://github.com/luftaquila/monolith/releases/download/${{ env.tag }}/monolith-installer-${{ env.tag }}.exe)" |