55 branches : ' *'
66 pull_request :
77 branches : ' *'
8+ release :
9+ types : published
810
911jobs :
10- build :
12+ build-projects :
1113 runs-on : ubuntu-22.04
1214 name : Build & upload hex
1315 steps :
@@ -19,23 +21,85 @@ jobs:
1921 with :
2022 name : radio-bridge
2123 path : radio-bridge.hex
24+ if-no-files-found : error
2225 - name : Upload Radio Bridge Dev hex file
2326 uses : actions/upload-artifact@v4
2427 with :
2528 name : radio-bridge-dev
2629 path : radio-bridge-dev.hex
30+ if-no-files-found : error
2731 - name : Upload Radio Remote hex file
2832 uses : actions/upload-artifact@v4
2933 with :
3034 name : radio-remote
3135 path : radio-remote.hex
36+ if-no-files-found : error
3237 - name : Upload Radio Remote Dev hex file
3338 uses : actions/upload-artifact@v4
3439 with :
3540 name : radio-remote-dev
3641 path : radio-remote-dev.hex
42+ if-no-files-found : error
3743 - name : Upload Local Sensors hex file
3844 uses : actions/upload-artifact@v4
3945 with :
4046 name : local-sensors
4147 path : local-sensors.hex
48+ if-no-files-found : error
49+
50+ release-asset :
51+ name : Upload artifact as GH Release asset
52+ needs : build-projects
53+ if : github.event_name == 'release'
54+ runs-on : ubuntu-latest
55+ steps :
56+ - name : Set the GH Release tag to env variable $TAG
57+ run : echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
58+ - name : Download all hex file
59+ uses : actions/download-artifact@v4
60+ id : download-hex-files
61+ - name : Upload Radio Bridge hex file to GH Release
62+ uses : actions/upload-release-asset@v1
63+ env :
64+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65+ with :
66+ upload_url : ${{github.event.release.upload_url}}
67+ asset_path : ${{steps.download-hex-files.outputs.download-path}}/radio-bridge/radio-bridge.hex
68+ asset_name : radio-bridge-${{ env.TAG }}.hex
69+ asset_content_type : text/plain
70+ - name : Upload Radio Bridge Dev hex file to GH Release
71+ uses : actions/upload-release-asset@v1
72+ env :
73+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74+ with :
75+ upload_url : ${{github.event.release.upload_url}}
76+ asset_path : ${{steps.download-hex-files.outputs.download-path}}/radio-bridge-dev/radio-bridge-dev.hex
77+ asset_name : radio-bridge-${{ env.TAG }}-dev.hex
78+ asset_content_type : text/plain
79+ - name : Upload Radio Remote hex file to GH Release
80+ uses : actions/upload-release-asset@v1
81+ env :
82+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
83+ with :
84+ upload_url : ${{github.event.release.upload_url}}
85+ asset_path : ${{steps.download-hex-files.outputs.download-path}}/radio-remote/radio-remote.hex
86+ asset_name : radio-remote-${{ env.TAG }}.hex
87+ asset_content_type : text/plain
88+ - name : Upload Radio Remote Dev hex file to GH Release
89+ uses : actions/upload-release-asset@v1
90+ env :
91+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92+ with :
93+ upload_url : ${{github.event.release.upload_url}}
94+ asset_path : ${{steps.download-hex-files.outputs.download-path}}/radio-remote-dev/radio-remote-dev.hex
95+ asset_name : radio-remote-${{ env.TAG }}-dev.hex
96+ asset_content_type : text/plain
97+ - name : Upload Local Sensors hex file to GH Release
98+ uses : actions/upload-release-asset@v1
99+ env :
100+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
101+ with :
102+ upload_url : ${{github.event.release.upload_url}}
103+ asset_path : ${{steps.download-hex-files.outputs.download-path}}/local-sensors/local-sensors.hex
104+ asset_name : local-sensors-${{ env.TAG }}.hex
105+ asset_content_type : text/plain
0 commit comments