remove unused dependancy #11
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: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version number (format X.Y.Z)' | |
required: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
include: | |
- os: windows-latest | |
artifact-name: windows-exe | |
dist-path: dist/ | |
- os: ubuntu-latest | |
artifact-name: linux-bin | |
dist-path: dist/ | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13.1' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
pip install -r requirements.txt | |
- name: Build executable | |
run: | | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
pyinstaller --noconfirm --onefile --console --name "flasher" --icon "icon.ico" "flash.py" | |
else | |
pyinstaller --noconfirm --onefile --console --name "flasher" --icon "icon.png" "flash.py" | |
fi | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: ${{ matrix.dist-path }}/flasher* | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Ensure version format (manual builds) | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
run: | | |
if [[ "${{ inputs.version }}" != v* ]]; then | |
echo "VERSION=v${{ inputs.version }}" >> $GITHUB_ENV | |
else | |
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV | |
fi | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} | |
with: | |
tag_name: ${{ github.ref }} | |
name: Release ${{ github.ref_name }} | |
body: | | |
Auto-generated release from CI build | |
- Windows: flasher.exe | |
- Linux: flasher | |
files: | | |
artifacts/windows-exe/flasher.exe | |
artifacts/linux-bin/flasher | |
- name: Create Manual Build | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
tag_name: manual-${{ env.VERSION }} | |
name: Manual Build (${{ env.VERSION }}) | |
body: | | |
Unofficial build triggered manually | |
**Version**: ${{ env.VERSION }} | |
draft: true | |
prerelease: true | |
files: | | |
artifacts/windows-exe/flasher.exe | |
artifacts/linux-bin/flasher |