Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ jobs:
uses: actions/checkout@v4
- name: Update Package Lists
run: sudo apt-get update
- name: Install Dependencies
- name: Install Base Dependencies
run: sudo apt-get install valgrind g++ make --fix-missing
- name: Install Project Dependencies
run: make install
- name: Build HeliosCLI
run: make -j
working-directory: HeliosCLI
- name: Archive HeliosCLI artifacts
run: zip -r "helioscli.zip" .
run: zip -r "helioscli.zip" build/
working-directory: HeliosCLI
- name: Upload HeliosCLI Artifact
uses: actions/upload-artifact@v4
Expand All @@ -79,14 +81,14 @@ jobs:
name: helioscli-artifacts
path: ./HeliosCLI
- name: Set execute permissions for test script
run: chmod +x ./runtests.sh
run: chmod +x ./run_tests.sh
working-directory: tests
- name: Run general tests
run: ./runtests.sh
run: ./run_tests.sh
working-directory: tests

embedded:
needs: [setup, build, tests]
needs: [setup, tests]
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
Expand All @@ -95,25 +97,26 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Dependencies
- name: Update Package Lists
run: sudo apt-get update
- name: Install Base Dependencies
run: sudo apt-get install make --fix-missing
- name: Install Project Dependencies
run: make install
working-directory: HeliosEmbedded
- name: Build Binary
- name: Build Embedded using unified Makefile
run: |
export HELIOS_VERSION_MAJOR=${{ needs.setup.outputs.helios_version_major }}
export HELIOS_VERSION_MINOR=${{ needs.setup.outputs.helios_version_minor }}
export HELIOS_BUILD_NUMBER=${{ needs.setup.outputs.helios_build_number }}
export HELIOS_VERSION_NUMBER=${{ needs.setup.outputs.helios_version_number }}
make -j build
working-directory: HeliosEmbedded
make embedded
- name: Archive HeliosEmbedded artifacts
run: zip -r "embedded-firmware.zip" .
working-directory: HeliosEmbedded
run: zip -r "embedded-firmware.zip" HeliosEmbedded/build/
- name: Upload HeliosEmbedded Artifact
uses: actions/upload-artifact@v4
with:
name: embedded-firmware
path: HeliosEmbedded/embedded-firmware.zip
path: embedded-firmware.zip

wasm:
needs: [setup, build, tests, embedded]
Expand All @@ -131,12 +134,12 @@ jobs:
./emsdk install latest
./emsdk activate latest
working-directory: HeliosLib
- name: Build Webassembly
- name: Build WebAssembly
run: |
source ./emsdk/emsdk_env.sh
export HELIOS_VERSION_MAJOR=${{ needs.setup.outputs.helios_version_major }}
export HELIOS_VERSION_MINOR=${{ needs.setup.outputs.helios_version_minor }}
export HELIOS_BUILD_NUMBER=${{ needs.setup.outputs.helios_build_number }}
export HELIOS_VERSION_NUMBER=${{ needs.setup.outputs.helios_version_number }}
make -j wasm
make wasm
working-directory: HeliosLib
150 changes: 75 additions & 75 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,58 @@ jobs:
steps:
- name: Checkout current repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for version calculation
- name: Update Package Lists
run: sudo apt-get update
- name: Install Dependencies
- name: Install Base Dependencies
run: sudo apt-get install valgrind g++ make --fix-missing
- name: Build HeliosCLI
run: make -j
working-directory: HeliosCLI
- name: Archive HeliosCLI artifacts
run: zip -r "helioscli.zip" .
working-directory: HeliosCLI
- name: Upload HeliosCLI Artifact
- name: Install Project Dependencies
run: make install
- name: Install Emscripten
run: |
sudo apt install -y cmake python3
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
- name: Build Complete Package
run: |
source ./emsdk/emsdk_env.sh
make package
- name: Upload Complete Package Artifact
uses: actions/upload-artifact@v4
with:
name: helioscli-artifacts
path: HeliosCLI/helioscli.zip
name: helios-complete-package
path: helios-*.zip

tests:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v4
- name: Download HeliosCLI Artifact
- name: Download Complete Package
uses: actions/download-artifact@v4
with:
name: helioscli-artifacts
path: ./HeliosCLI
name: helios-complete-package
path: ./package
- name: Extract Package for Testing
run: |
cd package
unzip helios-*.zip -d extracted/
# Copy CLI binary to expected location for tests
mkdir -p ../HeliosCLI/build/desktop/
cp extracted/cli/helios ../HeliosCLI/build/desktop/
- name: Set execute permissions for test script
run: chmod +x ./runtests.sh
run: chmod +x ./run_tests.sh
working-directory: tests
- name: Run general tests
run: ./runtests.sh
run: ./run_tests.sh
working-directory: tests

embedded:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Dependencies
run: make install
working-directory: HeliosEmbedded
- name: Build Binary
run: make build
working-directory: HeliosEmbedded
- name: Archive HeliosEmbedded artifacts
run: zip -r "embedded-firmware.zip" .
working-directory: HeliosEmbedded
- name: Upload HeliosEmbedded Artifact
uses: actions/upload-artifact@v4
with:
name: embedded-firmware
path: HeliosEmbedded/embedded-firmware.zip

release:
needs: embedded
needs: tests
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -125,26 +116,17 @@ jobs:
git tag ${{ env.new_tag }}
git push origin ${{ env.new_tag }}

- name: Download HeliosCLI Artifact
uses: actions/download-artifact@v4
with:
name: helioscli-artifacts
path: ./artifact/helioscli

- name: Download HeliosEmbedded Artifact
- name: Download Complete Package
uses: actions/download-artifact@v4
with:
name: embedded-firmware
path: ./artifact/embedded

- name: Create directories for unzipping
run: mkdir -p ./artifact/unzipped/helioscli ./artifact/unzipped/embedded

- name: Unzip HeliosCLI Artifact
run: unzip ./artifact/helioscli/helioscli.zip -d ./artifact/unzipped/helioscli
name: helios-complete-package
path: ./package

- name: Unzip HeliosEmbedded Artifact
run: unzip ./artifact/embedded/embedded-firmware.zip -d ./artifact/unzipped/embedded
- name: Extract Package for Release
run: |
cd package
unzip helios-*.zip -d extracted/
ls -la extracted/

- name: Create GitHub Release
id: create_release
Expand All @@ -154,58 +136,76 @@ jobs:
name: Helios ${{ env.new_version }}
body: |
Release of Helios version ${{ env.new_version }}

This release includes:
- CLI binary for desktop use
- Embedded firmware files (hex, bin, elf, map)
- WebAssembly library for web integration
- Complete documentation

Download the complete package or individual components below.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Assets (helios.bin)
- name: Upload Complete Package
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/unzipped/embedded/helios.bin
asset_name: helios.bin
asset_content_type: application/octet-stream
asset_path: ./package/helios-*.zip
asset_name: helios-complete-${{ env.new_version }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Assets (helios.elf)
- name: Upload CLI Binary
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/unzipped/embedded/helios.elf
asset_name: helios.elf
asset_path: ./package/extracted/cli/helios
asset_name: helios-cli
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Assets (helios.map)
- name: Upload Embedded Hex File
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/unzipped/embedded/helios.map
asset_name: helios.map
asset_path: ./package/extracted/embedded/helios.hex
asset_name: helios.hex
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Assets (helios.hex)
- name: Upload Embedded Binary
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/unzipped/embedded/helios.hex
asset_name: helios.hex
asset_path: ./package/extracted/embedded/helios.bin
asset_name: helios.bin
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Assets (Helios CLI)
- name: Upload WASM Library
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/unzipped/helioscli/helios
asset_name: helios
asset_content_type: application/octet-stream
asset_path: ./package/extracted/wasm/HeliosLib.js
asset_name: HeliosLib.js
asset_content_type: application/javascript
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload WASM Binary
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./package/extracted/wasm/HeliosLib.wasm
asset_name: HeliosLib.wasm
asset_content_type: application/wasm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

58 changes: 58 additions & 0 deletions Helios/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.SUFFIXES:
.PHONY: all clean

TARGET ?= desktop

ifeq ($(TARGET),desktop)
CC = g++
AR = ar cru
CFLAGS = -O2 -Wall -std=c++11 -MMD -g
DEFINES = -D HELIOS_CLI
else ifeq ($(TARGET),avr)
AVR_CHIP = attiny85
# OS Detection for AVR toolchain paths
ifeq ($(OS),Windows_NT) # Windows
BINDIR = "C:/Program Files (x86)/Atmel/Studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/"
else ifeq ($(shell uname),Linux)
# Use system-installed AVR toolchain (from apt-get install gcc-avr avr-libc)
BINDIR =
else ifeq ($(shell uname),Darwin)
BINDIR = /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/
else
$(error Unknown operating system for AVR build)
endif
CC = $(BINDIR)avr-g++
AR = $(BINDIR)avr-gcc-ar rcs
CFLAGS = -Os -Wall -std=gnu++17 -MMD -mmcu=$(AVR_CHIP) -flto -fno-exceptions
DEFINES = -DHELIOS_EMBEDDED -D__AVR_ATtiny85__ -DF_CPU=8000000L
else ifeq ($(TARGET),wasm)
CC = em++
AR = emar rcs
CFLAGS = -O2 -std=c++17 -Wall -MMD
DEFINES = -DWASM -DHELIOS_CLI
else
$(error Unknown TARGET '$(TARGET)')
endif

OUTDIR = build/$(TARGET)
OUTFILE = $(OUTDIR)/helios.a

SRC = $(wildcard *.cpp)
OBJ = $(SRC:%.cpp=$(OUTDIR)/%.o)
DEP = $(OBJ:.o=.d)

all: $(OUTFILE)

$(OUTDIR):
mkdir -p $(OUTDIR)

$(OUTDIR)/%.o: %.cpp | $(OUTDIR)
$(CC) $(CFLAGS) $(DEFINES) -c $< -o $@

$(OUTFILE): $(OBJ)
$(AR) $@ $^

clean:
rm -rf build

-include $(DEP)
Loading
Loading