Skip to content
Merged
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
40 changes: 35 additions & 5 deletions .github/workflows/manual-compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ name: Manual Compile
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to compile (bsom/b5som/both)'
required: true
default: 'bsom'
type: choice
options:
- bsom
- b5som
- both
branch:
description: 'Branch to compile'
required: false
Expand All @@ -14,23 +23,44 @@ jobs:
compile:
name: Compile Firmware
runs-on: ubuntu-latest
strategy:
matrix:
platform: ['bsom', 'b5som']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.event.inputs.branch || github.ref }}

- name: Compile application
id: compile
- name: Compile BSOM application
id: compile-bsom
if: matrix.platform == 'bsom' && (github.event.inputs.platform == 'bsom' || github.event.inputs.platform == 'both')
uses: particle-iot/compile-action@9dbe1eb567c6268f1baa7458217d5d6e5553850d
with:
particle-platform-name: 'bsom'
device-os-version: 6.2.1

- name: Upload artifact
- name: Compile B5SOM application
id: compile-b5som
if: matrix.platform == 'b5som' && (github.event.inputs.platform == 'b5som' || github.event.inputs.platform == 'both')
uses: particle-iot/compile-action@9dbe1eb567c6268f1baa7458217d5d6e5553850d
with:
particle-platform-name: 'b5som'
device-os-version: 6.2.1

- name: Upload BSOM artifact
if: matrix.platform == 'bsom' && (github.event.inputs.platform == 'bsom' || github.event.inputs.platform == 'both')
uses: actions/upload-artifact@v4
with:
name: bsom-firmware-binary
path: ${{ steps.compile-bsom.outputs.firmware-path }}
retention-days: 1

- name: Upload B5SOM artifact
if: matrix.platform == 'b5som' && (github.event.inputs.platform == 'b5som' || github.event.inputs.platform == 'both')
uses: actions/upload-artifact@v4
with:
name: firmware-binary
path: ${{ steps.compile.outputs.firmware-path }}
name: b5som-firmware-binary
path: ${{ steps.compile-b5som.outputs.firmware-path }}
retention-days: 1
89 changes: 73 additions & 16 deletions .github/workflows/manual-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ name: Manual Release
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to build (bsom/b5som/both)'
required: true
default: 'both'
type: choice
options:
- bsom
- b5som
- both
branch:
description: 'Branch to release'
required: false
Expand All @@ -24,48 +33,96 @@ jobs:
name: Create Release
runs-on: ubuntu-latest
outputs:
firmware-path: ${{ steps.compile.outputs.firmware-path }}
firmware-version: ${{ steps.compile.outputs.firmware-version }}
firmware-version-updated: ${{ steps.compile.outputs.firmware-version-updated }}
firmware-version: ${{ steps.compile-bsom.outputs.firmware-version || steps.compile-b5som.outputs.firmware-version }}
firmware-version-updated: ${{ steps.compile-bsom.outputs.firmware-version-updated || steps.compile-b5som.outputs.firmware-version-updated }}
release-url: ${{ steps.release.outputs.html_url }}
strategy:
matrix:
platform: ['bsom', 'b5som']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch || github.ref }}

- name: Compile application
id: compile
- name: Compile BSOM application
id: compile-bsom
if: matrix.platform == 'bsom' && (github.event.inputs.platform == 'bsom' || github.event.inputs.platform == 'both')
uses: particle-iot/compile-action@v1
with:
particle-platform-name: 'bsom'
auto-version: ${{ github.event.inputs.force_version_increment == 'yes' }}
device-os-version: 6.2.1

- name: Upload artifacts
- name: Compile B5SOM application
id: compile-b5som
if: matrix.platform == 'b5som' && (github.event.inputs.platform == 'b5som' || github.event.inputs.platform == 'both')
uses: particle-iot/compile-action@v1
with:
particle-platform-name: 'b5som'
auto-version: false
device-os-version: 6.2.1

- name: Upload BSOM artifacts
if: matrix.platform == 'bsom' && (github.event.inputs.platform == 'bsom' || github.event.inputs.platform == 'both')
uses: actions/upload-artifact@v4
with:
name: release-artifacts
name: bsom-release-artifacts
path: |
${{ steps.compile.outputs.firmware-path }}
${{ steps.compile.outputs.target-path }}
${{ steps.compile-bsom.outputs.firmware-path }}
${{ steps.compile-bsom.outputs.target-path }}

- name: Upload B5SOM artifacts
if: matrix.platform == 'b5som' && (github.event.inputs.platform == 'b5som' || github.event.inputs.platform == 'both')
uses: actions/upload-artifact@v4
with:
name: b5som-release-artifacts
path: |
${{ steps.compile-b5som.outputs.firmware-path }}
${{ steps.compile-b5som.outputs.target-path }}

- name: Create archive and rename firmware files for BSOM
if: matrix.platform == 'bsom' && (github.event.inputs.platform == 'bsom' || github.event.inputs.platform == 'both') && steps.compile-bsom.outputs.firmware-version-updated == 'true'
run: |
tar -czf debug-objects-bsom.tar.gz ${{ steps.compile-bsom.outputs.target-path }}
cp ${{ steps.compile-bsom.outputs.firmware-path }} firmware-bsom-${{ steps.compile-bsom.outputs.firmware-version }}.bin

- name: Create archive of target directory
if: steps.compile.outputs.firmware-version-updated == 'true'
- name: Create archive and rename firmware files for B5SOM
if: matrix.platform == 'b5som' && (github.event.inputs.platform == 'b5som' || github.event.inputs.platform == 'both')
run: |
tar -czf debug-objects.tar.gz ${{ steps.compile.outputs.target-path }}
tar -czf debug-objects-b5som.tar.gz ${{ steps.compile-b5som.outputs.target-path }}
VERSION=${{ steps.compile-bsom.outputs.firmware-version || steps.compile-b5som.outputs.firmware-version }}
cp ${{ steps.compile-b5som.outputs.firmware-path }} firmware-b5som-$VERSION.bin

- name: Upload versioned firmware artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-versioned-firmware
path: |
firmware-${{ matrix.platform }}-*.bin
debug-objects-${{ matrix.platform }}.tar.gz

create-release:
name: Create GitHub Release
needs: release
runs-on: ubuntu-latest
if: needs.release.outputs.firmware-version-updated == 'true'
steps:
- name: Download all versioned firmware artifacts
uses: actions/download-artifact@v4
with:
path: ./release-files

- name: Create GitHub release
id: release
if: steps.compile.outputs.firmware-version-updated == 'true'
uses: ncipollo/release-action@v1
with:
artifacts: ${{ steps.compile.outputs.firmware-path }},debug-objects.tar.gz
artifacts: ./release-files/**/*
generateReleaseNotes: ${{ github.event.inputs.release_notes == '' }}
body: ${{ github.event.inputs.release_notes }}
name: "Firmware v${{ steps.compile.outputs.firmware-version }} (Manual)"
tag: "v${{ steps.compile.outputs.firmware-version }}-manual"
name: "Firmware v${{ needs.release.outputs.firmware-version }} (Manual)"
tag: "v${{ needs.release.outputs.firmware-version }}-manual"
commit: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
16 changes: 13 additions & 3 deletions .github/workflows/manual-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ name: Manual Upload to Particle
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to upload (bsom/b5som)'
required: true
default: 'bsom'
type: choice
options:
- bsom
- b5som
product_id:
description: 'Custom product ID (defaults to secret)'
required: false
Expand Down Expand Up @@ -40,15 +48,15 @@ jobs:
if: github.event.inputs.use_release_artifact != 'yes'
uses: particle-iot/compile-action@v1
with:
particle-platform-name: 'bsom'
particle-platform-name: ${{ github.event.inputs.platform }}
device-os-version: 6.2.1

- name: Download release artifacts
if: github.event.inputs.use_release_artifact == 'yes'
uses: dawidd6/action-download-artifact@v6
with:
workflow: manual-release.yaml
name: release-artifacts
name: ${{ github.event.inputs.platform }}-release-artifacts
path: ./firmware

- name: Find firmware binary
Expand All @@ -60,7 +68,9 @@ jobs:
FIRMWARE="${{ steps.compile.outputs.firmware-path }}"
fi
echo "Using firmware: $FIRMWARE"
echo "firmware-path=$FIRMWARE" >> $GITHUB_OUTPUT
# Create a properly named firmware file
cp "$FIRMWARE" "firmware-${{ github.event.inputs.platform }}-${{ github.event.inputs.version }}.bin"
echo "firmware-path=firmware-${{ github.event.inputs.platform }}-${{ github.event.inputs.version }}.bin" >> $GITHUB_OUTPUT

- name: Upload product firmware to Particle
uses: particle-iot/firmware-upload-action@v1
Expand Down
35 changes: 28 additions & 7 deletions .github/workflows/pr-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,56 @@ jobs:
name: Compile Firmware
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
platform: ['bsom', 'b5som']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Compile application
id: compile
- name: Compile BSOM application
id: compile-bsom
if: matrix.platform == 'bsom'
uses: particle-iot/compile-action@9dbe1eb567c6268f1baa7458217d5d6e5553850d
with:
particle-platform-name: 'bsom'
device-os-version: 6.2.1

- name: Upload artifact
- name: Compile B5SOM application
id: compile-b5som
if: matrix.platform == 'b5som'
uses: particle-iot/compile-action@9dbe1eb567c6268f1baa7458217d5d6e5553850d
with:
particle-platform-name: 'b5som'
device-os-version: 6.2.1

- name: Upload BSOM artifact
if: matrix.platform == 'bsom'
uses: actions/upload-artifact@v4
with:
name: bsom-firmware-artifact
path: ${{ steps.compile-bsom.outputs.firmware-path }}
retention-days: 1

- name: Upload B5SOM artifact
if: matrix.platform == 'b5som'
uses: actions/upload-artifact@v4
with:
name: firmware-artifact
path: ${{ steps.compile.outputs.firmware-path }}
name: b5som-firmware-artifact
path: ${{ steps.compile-b5som.outputs.firmware-path }}
retention-days: 1

flash:
name: Flash Test Device
needs: compile
runs-on: ubuntu-latest
steps:
- name: Download firmware artifact
- name: Download BSOM firmware artifact
uses: actions/download-artifact@v4
with:
name: firmware-artifact
name: bsom-firmware-artifact
path: ./firmware

- name: Find firmware binary
Expand Down
Loading