Merge pull request #22 from proddy/main #32
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: EMS-ESP Flasher | |
on: | |
workflow_dispatch: # Manually start a workflow | |
push: | |
tags: | |
- "v*.*.*" | |
branches: | |
- main | |
paths-ignore: | |
- '.github/**' # Ignore changes towards the .github directory | |
- '*.md' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
architecture: 'x64' | |
- name: Install requirements | |
run: | | |
pip install -r requirements.txt -r requirements_build.txt | |
pip install -e . | |
- name: Run PyInstaller | |
run: | | |
python -m PyInstaller -F -w -n EMS-ESP-Flasher -i icon.ico emsesp_flasher\__main__.py | |
- name: Upload Artifact | |
# uses: actions/upload-artifact@v4 | |
uses: jason2866/[email protected] | |
with: | |
name: Windows | |
path: dist/EMS-ESP-Flasher.exe | |
build-ubuntu: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install libnotify-dev libsdl2-dev | |
- name: Install requirements | |
run: | | |
pip install -r requirements.txt -r requirements_build.txt | |
pip install -e . | |
- name: Run PyInstaller | |
run: | | |
python -m PyInstaller -F -w -n EMS-ESP-Flasher -i icon.ico emsesp_flasher/__main__.py | |
- name: Move app | |
run: | | |
mv dist/EMS-ESP-Flasher EMS-ESP-Flasher | |
- name: 'Tar files' | |
run: tar -cvf Ubuntu.tar EMS-ESP-Flasher | |
- name: Upload Artifact | |
# uses: actions/upload-artifact@v4 | |
uses: jason2866/[email protected] | |
with: | |
name: Ubuntu | |
path: Ubuntu.tar | |
build-macos: | |
runs-on: macos-13 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install requirements | |
run: | | |
pip install -r requirements.txt -r requirements_build.txt | |
pip install -e . | |
- name: Run PyInstaller | |
run: | | |
python -m PyInstaller -F -w -n EMS-ESP-Flasher -i icon.icns emsesp_flasher/__main__.py | |
- name: Move app | |
run: | | |
mv dist/EMS-ESP-Flasher.app EMS-ESP-Flasher-macOS.app | |
- name: 'Tar files' | |
run: tar -cvf macOS.tar EMS-ESP-Flasher-macOS.app | |
- name: 'Upload Artifact' | |
# uses: actions/upload-artifact@v4 | |
uses: jason2866/[email protected] | |
with: | |
name: macOS | |
path: macOS.tar | |
build-macos-arm: | |
runs-on: macos-14 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install requirements | |
run: | | |
pip install -r requirements.txt -r requirements_build.txt | |
pip install -e . | |
- name: Run PyInstaller | |
run: | | |
python -m PyInstaller -F -w -n EMS-ESP-Flasher -i icon.icns emsesp_flasher/__main__.py | |
- name: Move app | |
run: | | |
mv dist/EMS-ESP-Flasher.app EMS-ESP-Flasher-macOSarm.app | |
- name: 'Tar files' | |
run: tar -cvf macOSarm.tar EMS-ESP-Flasher-macOSarm.app | |
- name: 'Upload Artifact' | |
# uses: actions/upload-artifact@v4 | |
uses: jason2866/[email protected] | |
with: | |
name: macOSarm | |
path: macOSarm.tar | |
release: | |
name: Upload binaries to release section | |
needs: [build-windows, build-ubuntu, build-macos, build-macos-arm] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download built binaries artifacts | |
# uses: actions/download-artifact@v4 | |
uses: jason2866/[email protected] | |
with: | |
name: | | |
Windows | |
Ubuntu | |
macOS | |
macOSarm | |
path: | | |
binary | |
binary | |
binary | |
binary | |
- name: Display downloaded artifact files | |
run: | | |
ls -R ./ | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
prerelease: false | |
files: | | |
binary/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |