chore: adjust wording in instruction and use lowercase for releases #13
Workflow file for this run
This file contains hidden or 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: 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 | |
| # Install project dependencies directly from pyproject.toml without building the package | |
| python -c " | |
| import tomllib | |
| with open('pyproject.toml', 'rb') as f: | |
| data = tomllib.load(f) | |
| deps = data['project']['dependencies'] | |
| print('Installing dependencies:', deps) | |
| import subprocess | |
| subprocess.run(['pip', 'install'] + deps, check=True) | |
| " | |
| # Install certifi for SSL certificate support | |
| pip install certifi | |
| - 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 ${{ github.ref_name }} --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: ${{ github.ref_name }} | |
| name: Echo ${{ github.ref_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |