Skip to content

feat: Update Python version, fix frontend paths, and enhance exam ins… #6

feat: Update Python version, fix frontend paths, and enhance exam ins…

feat: Update Python version, fix frontend paths, and enhance exam ins… #6

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.13']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y portaudio19-dev python3-dev
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Install frontend dependencies
run: |
cd frontend
npm install
cd ..
- name: Build frontend
run: |
cd frontend
npm run build
cd ..
- name: Build executable
run: pyinstaller echo.spec --clean --noconfirm
- name: Create portable package (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p dist/Echo-Portable
cp dist/Echo dist/Echo-Portable/
chmod +x dist/Echo dist/Echo-Portable/Echo
cp README.md dist/Echo-Portable/ 2>/dev/null || true
- name: Create portable package (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir -p dist/Echo-Portable
copy dist\Echo.exe dist\Echo-Portable\
copy README.md dist\Echo-Portable\ 2>nul || echo README.md not found
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: |
dist/Echo*
dist/Echo-Portable/**
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
if: always()
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Clean up existing release
run: |
gh release delete v1.0.0 --yes || echo "No existing release to delete"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
build-ubuntu-latest/*
build-windows-latest/*
draft: false
prerelease: false
generate_release_notes: true
tag_name: v1.0.0
name: Echo v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}