Skip to content

create release workflow #1

create release workflow

create release workflow #1

Workflow file for this run

name: Release Build
on:
push:
tags:
- 'v*'
jobs:
create-release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create GitHub Release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
generateReleaseNotes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Arduino-build:
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Arduino CLI
run: |
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
sudo mv bin/arduino-cli /usr/local/bin/
- name: Set up Arduino CLI
run: |
arduino-cli config init
arduino-cli core update-index
arduino-cli core install arduino:avr
- name: Install Adafruit GFX Library (via Library Manager)
run: |
arduino-cli lib install "Adafruit GFX Library"
arduino-cli lib install "SD"
- name: Clone SH1106, TinyGPSPlus, and Base64 libraries
run: |
mkdir -p custom-libraries
git clone https://github.com/wonho-maker/Adafruit_SH1106 custom-libraries/Adafruit_SH1106
git clone https://github.com/mikalhart/TinyGPSPlus custom-libraries/TinyGPSPlus
git clone https://github.com/Xander-Electronics/Base64 custom-libraries/Base64
- name: Compile sketch for Arduino Mega 2560
run: |
mkdir -p build-out
arduino-cli compile \
--fqbn arduino:avr:mega \
--libraries custom-libraries \
--output-dir build-out \
Source/HamMessenger
- name: Rename firmware file for release
run: |
mkdir -p output
cp build-out/HamMessenger.ino.hex output/HamMessenger-mega2560.hex
- name: Upload Arduino firmware
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: output/HamMessenger-mega2560.hex
asset_name: HamMessenger-mega2560.hex
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
gui-windows-build:
needs: create-release
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
pip install -r Source/GUI/requirements-windows.txt
pip install -U pyinstaller
- name: Build GUI with PyInstaller
run: |
cd Source/GUI
pyinstaller --noconfirm --windowed --name HamMessenger --onefile Qt.py
- name: Copy built GUI executable
run: |
mkdir output
copy Source\GUI\dist\HamMessenger.exe output\HamMessenger-windows.exe
- name: Upload Windows GUI
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: output/HamMessenger-windows.exe
asset_name: HamMessenger-windows.exe
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
gui-mac-build:
needs: create-release
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r Source/GUI/requirements-macos.txt
pip install -U pyinstaller
- name: Build macOS GUI with PyInstaller
run: |
cd Source/GUI
python -m PyInstaller --windowed --name HamMessenger --onefile Qt.py
- name: Install create-dmg
run: brew install create-dmg
- name: Create DMG
run: |
mkdir -p output
create-dmg \
--volname "HamMessenger" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "HamMessenger.app" 200 190 \
--hide-extension "HamMessenger.app" \
--app-drop-link 600 185 \
output/HamMessenger-mac.dmg \
Source/GUI/dist/HamMessenger.app
- name: Upload macOS GUI
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: output/HamMessenger-mac.dmg
asset_name: HamMessenger-mac.dmg
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}