CI - Fast #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI - Fast | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/jaster-prj/devcontainer-zephyr-workspace:latest | |
| outputs: | |
| artifact-url: ${{ steps.artifact-upload.outputs.artifact-url }} | |
| steps: | |
| - name: link workspace | |
| run: | | |
| ln -s /workspace ./zephyr_workspace | |
| - name: Clone Application | |
| uses: actions/checkout@v4 | |
| with: | |
| path: './zephyr_workspace/app' | |
| submodules: recursive | |
| - name: link custom boards | |
| working-directory: ./zephyr_workspace/app/custom_boards | |
| run: | | |
| ./link.sh | |
| - name: patch git | |
| working-directory: ./zephyr_workspace/zephyr | |
| run: | | |
| git apply ../.patch/gpio_pcf857x.patch | |
| - name: save gartennode.pem | |
| working-directory: ./zephyr_workspace/bootloader/mcuboot | |
| run: | | |
| echo "$PEM" | base64 --decode > gartennode.pem | |
| shell: bash | |
| env: | |
| PEM: ${{ secrets.ZEPHYR_SIGN_KEY }} | |
| - name: build app | |
| working-directory: ./zephyr_workspace | |
| run: | | |
| west build -b gartennode app --build-dir build -- -DEXTRA_CONF_FILE=prj.conf | |
| imgtool sign --header-size 0x200 --align 8 --version 1.2 --slot-size 0x30000 --key bootloader/mcuboot/gartennode.pem --pad build/zephyr/zephyr.bin signed_zephyr.bin | |
| tar -czf software.tar.gz signed_zephyr.bin ./app/objdict/objdict.eds | |
| - name: Publish binary | |
| id: artifact-upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: softwarefile | |
| path: zephyr_workspace/software.tar.gz | |
| trigger: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger Flash | |
| run: | | |
| # Set the required variables | |
| repo_owner="jaster-prj" | |
| repo_name="gartennode_updater" | |
| event_type="trigger-workflow" | |
| artfifact_url=${{ needs.build.outputs.artifact-url }} | |
| curl -L \ | |
| -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.PAT }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/$repo_owner/$repo_name/dispatches \ | |
| -d "{\"event_type\": \"$event_type\", \"client_payload\": {\"artfifact_url\": \"$artfifact_url\"}}" |