@@ -4,6 +4,15 @@ name: Manual Release
44on :
55 workflow_dispatch :
66 inputs :
7+ platform :
8+ description : ' Platform to build (bsom/b5som/both)'
9+ required : true
10+ default : ' both'
11+ type : choice
12+ options :
13+ - bsom
14+ - b5som
15+ - both
716 branch :
817 description : ' Branch to release'
918 required : false
@@ -24,48 +33,96 @@ jobs:
2433 name : Create Release
2534 runs-on : ubuntu-latest
2635 outputs :
27- firmware-path : ${{ steps.compile.outputs.firmware-path }}
28- firmware-version : ${{ steps.compile.outputs.firmware-version }}
29- firmware-version-updated : ${{ steps.compile.outputs.firmware-version-updated }}
36+ firmware-version : ${{ steps.compile-bsom.outputs.firmware-version || steps.compile-b5som.outputs.firmware-version }}
37+ firmware-version-updated : ${{ steps.compile-bsom.outputs.firmware-version-updated || steps.compile-b5som.outputs.firmware-version-updated }}
3038 release-url : ${{ steps.release.outputs.html_url }}
39+ strategy :
40+ matrix :
41+ platform : ['bsom', 'b5som']
3142 steps :
3243 - name : Checkout code
3344 uses : actions/checkout@v4
3445 with :
3546 fetch-depth : 0
3647 ref : ${{ github.event.inputs.branch || github.ref }}
3748
38- - name : Compile application
39- id : compile
49+ - name : Compile BSOM application
50+ id : compile-bsom
51+ if : matrix.platform == 'bsom' && (github.event.inputs.platform == 'bsom' || github.event.inputs.platform == 'both')
4052 uses : particle-iot/compile-action@v1
4153 with :
4254 particle-platform-name : ' bsom'
4355 auto-version : ${{ github.event.inputs.force_version_increment == 'yes' }}
4456 device-os-version : 6.2.1
4557
46- - name : Upload artifacts
58+ - name : Compile B5SOM application
59+ id : compile-b5som
60+ if : matrix.platform == 'b5som' && (github.event.inputs.platform == 'b5som' || github.event.inputs.platform == 'both')
61+ uses : particle-iot/compile-action@v1
62+ with :
63+ particle-platform-name : ' b5som'
64+ auto-version : false
65+ device-os-version : 6.2.1
66+
67+ - name : Upload BSOM artifacts
68+ if : matrix.platform == 'bsom' && (github.event.inputs.platform == 'bsom' || github.event.inputs.platform == 'both')
4769 uses : actions/upload-artifact@v4
4870 with :
49- name : release-artifacts
71+ name : bsom- release-artifacts
5072 path : |
51- ${{ steps.compile.outputs.firmware-path }}
52- ${{ steps.compile.outputs.target-path }}
73+ ${{ steps.compile-bsom.outputs.firmware-path }}
74+ ${{ steps.compile-bsom.outputs.target-path }}
75+
76+ - name : Upload B5SOM artifacts
77+ if : matrix.platform == 'b5som' && (github.event.inputs.platform == 'b5som' || github.event.inputs.platform == 'both')
78+ uses : actions/upload-artifact@v4
79+ with :
80+ name : b5som-release-artifacts
81+ path : |
82+ ${{ steps.compile-b5som.outputs.firmware-path }}
83+ ${{ steps.compile-b5som.outputs.target-path }}
84+
85+ - name : Create archive and rename firmware files for BSOM
86+ if : matrix.platform == 'bsom' && (github.event.inputs.platform == 'bsom' || github.event.inputs.platform == 'both') && steps.compile-bsom.outputs.firmware-version-updated == 'true'
87+ run : |
88+ tar -czf debug-objects-bsom.tar.gz ${{ steps.compile-bsom.outputs.target-path }}
89+ cp ${{ steps.compile-bsom.outputs.firmware-path }} firmware-bsom-${{ steps.compile-bsom.outputs.firmware-version }}.bin
5390
54- - name : Create archive of target directory
55- if : steps.compile.outputs.firmware-version-updated == 'true'
91+ - name : Create archive and rename firmware files for B5SOM
92+ if : matrix.platform == 'b5som' && (github.event.inputs.platform == 'b5som' || github.event.inputs.platform == 'both')
5693 run : |
57- tar -czf debug-objects.tar.gz ${{ steps.compile.outputs.target-path }}
94+ tar -czf debug-objects-b5som.tar.gz ${{ steps.compile-b5som.outputs.target-path }}
95+ VERSION=${{ steps.compile-bsom.outputs.firmware-version || steps.compile-b5som.outputs.firmware-version }}
96+ cp ${{ steps.compile-b5som.outputs.firmware-path }} firmware-b5som-$VERSION.bin
97+
98+ - name : Upload versioned firmware artifacts
99+ uses : actions/upload-artifact@v4
100+ with :
101+ name : ${{ matrix.platform }}-versioned-firmware
102+ path : |
103+ firmware-${{ matrix.platform }}-*.bin
104+ debug-objects-${{ matrix.platform }}.tar.gz
105+
106+ create-release :
107+ name : Create GitHub Release
108+ needs : release
109+ runs-on : ubuntu-latest
110+ if : needs.release.outputs.firmware-version-updated == 'true'
111+ steps :
112+ - name : Download all versioned firmware artifacts
113+ uses : actions/download-artifact@v4
114+ with :
115+ path : ./release-files
58116
59117 - name : Create GitHub release
60118 id : release
61- if : steps.compile.outputs.firmware-version-updated == 'true'
62119 uses : ncipollo/release-action@v1
63120 with :
64- artifacts : ${{ steps.compile.outputs.firmware-path }},debug-objects.tar.gz
121+ artifacts : ./release-files/**/*
65122 generateReleaseNotes : ${{ github.event.inputs.release_notes == '' }}
66123 body : ${{ github.event.inputs.release_notes }}
67- name : " Firmware v${{ steps.compile .outputs.firmware-version }} (Manual)"
68- tag : " v${{ steps.compile .outputs.firmware-version }}-manual"
124+ name : " Firmware v${{ needs.release .outputs.firmware-version }} (Manual)"
125+ tag : " v${{ needs.release .outputs.firmware-version }}-manual"
69126 commit : ${{ github.sha }}
70127 token : ${{ secrets.GITHUB_TOKEN }}
71128 prerelease : true
0 commit comments