Skip to content

Commit

Permalink
workflow: Add workflow to attach release assets
Browse files Browse the repository at this point in the history
When a release is created this new workflow calls the other build
and test workflows and uploads the tested artifacts into github
release.
The existing workflows were modified to make them callable from other
workflows.
Also added zephyr.signed.bin as an artifact so that it can be added
as an asset to the github release.

Signed-off-by: Balaji Srinivasan <[email protected]>
  • Loading branch information
Balaji Srinivasan committed Jun 7, 2024
1 parent d894d92 commit 441b9b3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/attach_release_assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Workflow that attaches additional assets to github release.
name: Attach Release Assets

on:
release:
types: [created]

jobs:
trigger-build:
uses: ./.github/workflows/build.yml

trigger-dfu-check:
uses: ./.github/workflows/dfu_check.yml

trigger-target-test:
uses: ./.github/workflows/on_target.yml

attach-assets:
runs-on: ubuntu-22.04
# Only make a release if the above jobs are passing
needs: [trigger-build, trigger-dfu-check, trigger-target-test]
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: oob-t91x

- name: Rename artifacts
run: |
mv merged.hex hello.nrfcloud.com-${{ github.ref_name }}-thingy91x-debug-app.hex
mv app/zephyr/zephyr.signed.bin hello.nrfcloud.com-${{ github.ref_name }}-thingy91x-debug-app_update_signed.bin
- name: Deploy release to github
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
files: hello.nrfcloud.com-*.*
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build

on:
workflow_call:
push:
branches:
- main
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dfu_check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: DFU image compatibility check

on:
workflow_call:
push:
branches:
- main
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/on_target.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: On_target

on:
workflow_call:
workflow_dispatch:
inputs:
run_test:
Expand Down Expand Up @@ -47,8 +48,11 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: oob-t91x-hex
path: thingy91x-oob/build/zephyr/merged.hex
name: oob-t91x
if-no-files-found: error
path: |
thingy91x-oob/build/merged.hex
thingy91x-oob/build/app/zephyr/zephyr.signed.bin
test:
if: github.event.inputs.run_test == 'yes' || github.event.inputs.run_test == '' || github.event.inputs.run_test == null
Expand Down

0 comments on commit 441b9b3

Please sign in to comment.