Skip to content

Refactor INI configuration #185

Refactor INI configuration

Refactor INI configuration #185

Workflow file for this run

name: Release Binaries
on:
workflow_dispatch:
release:
types:
- created
- prereleased
pull_request:
branches:
- master
- develop
paths:
- '.github/workflows/release.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-bhaptics:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- bhaptics_tactsuit_x16
- bhaptics_tactsuit_x16_pca9685
- bhaptics_tactsuit_x40
- bhaptics_tactosy2_forearm_left
- bhaptics_tactosy2_forearm_right
- bhaptics_tactosyh_hand_left
- bhaptics_tactosyh_hand_right
- bhaptics_tactosyf_foot_left
- bhaptics_tactosyf_foot_right
- bhaptics_tactal
- bhaptics_tactvisor
- bhaptics_tactglove_left
- bhaptics_tactglove_right
battery_flag:
- SS_BATTERY_ENABLED=true
env:
PLATFORMIO_BUILD_FLAGS: >-
${{ matrix.battery_flag && format('-D {0}', matrix.battery_flag) || '' }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Get firmware name
id: firmware_name
run: python3 ./.github/scripts/get-firmware-name.py ${{ matrix.target }} ""
- name: Cache PlatformIO target
uses: actions/cache@v4
with:
path: |
./.pio/build/${{ matrix.target }}
key: ${{ runner.os }}-pio-${{ matrix.target }}-${{ steps.firmware_name.outputs.firmware }}-${{ hashFiles('**/*.ini') }}
restore-keys: |
${{ runner.os }}-pio-${{ matrix.target }}-${{ steps.firmware_name.outputs.firmware }}-
${{ runner.os }}-pio-${{ matrix.target }}-
${{ runner.os }}-pio-
- name: Setup PlatformIO
uses: ./.github/actions/setup-platformio
with:
build_cache_dir: ./.pio/build_cache
cache: 'pip cache build_cache'
- name: Install libs
shell: bash
run: |
pio pkg install -e ${{matrix.target}}
- name: Build
run: |
pio run --environment ${{matrix.target}} --target release-archive
unzip -l ./.pio/build/${{ matrix.target }}/firmware.zip
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: firmware-${{matrix.target}}
path: ./.pio/build/${{ matrix.target }}/firmware.zip
retention-days: 5
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'senseshift/senseshift-firmware'
with:
asset_name: ${{matrix.target}}.zip
file: ./.pio/build/${{ matrix.target }}/firmware.zip
tag: ${{github.ref}}
build-opengloves:
if: github.repository == 'senseshift/senseshift-firmware'
runs-on: ubuntu-latest
strategy:
matrix:
target:
- opengloves_lucidgloves_proto3
- opengloves_lucidgloves_proto4
- opengloves_lucidgloves_proto4_ffb
- opengloves_indexer_c
- opengloves_indexer_cf
- opengloves_indexer_cs
- opengloves_indexer_csf
comm_flag:
- OPENGLOVES_COMMUNICATION=OPENGLOVES_COMM_SERIAL
- OPENGLOVES_COMMUNICATION=OPENGLOVES_COMM_BTSERIAL
env:
PLATFORMIO_BUILD_FLAGS: >-
${{ matrix.comm_flag && format('-D {0}', matrix.comm_flag) || '' }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Get firmware name
id: firmware_name
run: python3 ./.github/scripts/get-firmware-name.py ${{ matrix.target }} '${{ matrix.comm_flag }}'
- name: Cache PlatformIO target
uses: actions/cache@v4
with:
path: |
./.pio/build/${{ matrix.target }}
key: ${{ runner.os }}-pio-${{ matrix.target }}-${{ steps.firmware_name.outputs.firmware }}-${{ hashFiles('**/*.ini') }}
restore-keys: |
${{ runner.os }}-pio-${{ matrix.target }}-${{ steps.firmware_name.outputs.firmware }}-
${{ runner.os }}-pio-${{ matrix.target }}-
${{ runner.os }}-pio-
- name: Setup PlatformIO
uses: ./.github/actions/setup-platformio
with:
build_cache_dir: ./.pio/build_cache
cache: 'pip cache build_cache'
- name: Install libs
shell: bash
run: |
pio pkg install -e ${{matrix.target}}
- name: Build
run: |
pio run --environment ${{matrix.target}} --target release-archive
unzip -l ./.pio/build/${{ matrix.target }}/firmware.zip
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: firmware-${{ steps.firmware_name.outputs.firmware }}
path: ./.pio/build/${{ matrix.target }}/firmware.zip
retention-days: 5
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'senseshift/senseshift-firmware'
with:
asset_name: ${{ steps.firmware_name.outputs.firmware }}.zip
file: ./.pio/build/${{ matrix.target }}/firmware.zip
tag: ${{github.ref}}