diff --git a/.github/workflows/update-from-memfault.yaml b/.github/workflows/update-from-memfault.yaml index f4a39ce..6c03739 100644 --- a/.github/workflows/update-from-memfault.yaml +++ b/.github/workflows/update-from-memfault.yaml @@ -3,7 +3,11 @@ run-name: ${{ inputs.run_name }} env: DEFAULT_PYTHON: 3.8 + SDK_VER: # empty on: + push: + branches: + - gminn/pull-latest-memfault-sdk schedule: - cron: "8 0 * * *" workflow_dispatch: @@ -17,23 +21,49 @@ jobs: build: runs-on: ubuntu-latest - # Image generated from: https://github.com/memfault/memfault-port-playground/tree/master/docker/nrf-connect-sdk - container: - image: memfault/nrf-connect-sdk:2024-01-05 steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.DEFAULT_PYTHON }} + - name: Install needed packages + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends -y -qq \ + curl \ + ripgrep - name: Get latest Memfault MCU SDK version run: | - SDK_VER=$(rg 'VERSION:\s(\d+\.\d+\.\d+)' \ - <(curl -sSL 'https://raw.githubusercontent.com/memfault/memfault-firmware-sdk/master/VERSION') -r '$1' --no-filename --no-line-number) + echo "SDK_VER=$(rg 'VERSION:\s(\d+\.\d+\.\d+)' \ + <(curl -sSL 'https://raw.githubusercontent.com/memfault/memfault-firmware-sdk/master/VERSION') -r '$1' --no-filename --no-line-number)" >> $GITHUB_ENV - - name: Echo SDK Version + - name: Get Memfault MCU SDK version in west.yml run: | - echo $SDK_VER \ No newline at end of file + echo "REPO_SDK_VER=$(yq '.manifest.projects[1].revision' west.yml)" >> $GITHUB_ENV + + - name: Update west.yml + if: ${{ env.SDK_VER }} != ${{ env.REPO_SDK_VER }} + run: | + yq -i '.manifest.projects[1].revision = "${{ env.SDK_VER }}"' west.yml + git status + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GH_PAT }} + commit-message: | + chore(memfault): pull in latest memfault sdk + + ### Summary + + Update the Memfault SDK + + ### Test Plan + + CI + title: | + chore(memfault): pull in latest memfault sdk + base: main + branch: github-actions/update-to-memfault-v${{ env.SDK_VER }} + delete-branch: true + team-reviewers: memfault/owners-mcu + draft: true \ No newline at end of file