@@ -8,6 +8,7 @@ on: workflow_dispatch
8
8
env :
9
9
GH_TOKEN : ${{ secrets.NCS_GITHUB_UPMERGE_TOKEN }}
10
10
ZEPHYR_UPSTREAM : https://github.com/zephyrproject-rtos/zephyr
11
+ MCUBOOT_UPSTREAM : https://github.com/zephyrproject-rtos/mcuboot
11
12
PR_TARGET_BRANCH : upmerge-tmp
12
13
13
14
jobs :
@@ -31,15 +32,18 @@ jobs:
31
32
working-directory : ncs
32
33
run : |
33
34
west init -l nrf
34
- west update zephyr bsim
35
+ west update zephyr bsim mcuboot
35
36
git config --global user.email "noreply@nordicsemi.no"
36
37
git config --global user.name "Nordic Builder"
37
38
echo "SDK_ZEPHYR=$(west list zephyr -f {url} | awk -F// '{print $NF}')" >> $GITHUB_ENV
39
+ echo "SDK_MCUBOOT=$(west list mcuboot -f {url} | awk -F// '{print $NF}')" >> $GITHUB_ENV
38
40
39
41
- name : Try closing existing auto-upmerge PRs
40
42
run : |
41
43
SDK_ZEPHYR_PR=$(gh pr list --repo $SDK_ZEPHYR --label "auto-upmerge" --json number --jq .[0].number)
42
44
gh pr close $SDK_ZEPHYR_PR --repo $SDK_ZEPHYR | true
45
+ SDK_MCUBOOT_PR=$(gh pr list --repo $SDK_MCUBOOT --label "auto-upmerge" --json number --jq .[0].number)
46
+ gh pr close $SDK_MCUBOOT_PR --repo $SDK_MCUBOOT | true
43
47
SDK_NRF_PR=$(gh pr list --repo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY --label "auto-upmerge" --json number --jq .[0].number)
44
48
gh pr close $SDK_NRF_PR --repo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY | true
45
49
@@ -50,22 +54,42 @@ jobs:
50
54
git checkout -b upmerge_local
51
55
west ncs-upmerger zephyr
52
56
git push origin upmerge_local:auto-upmerge/$GITHUB_RUN_ID -u
57
+ MCUBOOT_UPSTREAM_REV=$(cat west.yml | awk -e '/- name: mcuboot/,/path: bootloader\/mcuboot/ { if ($0 ~ "revision:.*") { print $2; }; }')
53
58
54
59
UPSTREAMHASH=$(git rev-parse --short upstream/main)
55
60
ZEPHYR_PR_URL=$(gh pr create --base $PR_TARGET_BRANCH --title "[nrf mergeup] Merge upstream automatically up to commit $UPSTREAMHASH" --body "Automatic upmerge action" --repo $SDK_ZEPHYR --label "auto-upmerge")
56
61
echo "ZEPHYR_PR_URL=$ZEPHYR_PR_URL" >> $GITHUB_ENV
57
62
echo "Created PR: $ZEPHYR_PR_URL"
63
+ echo "MCUboot revision used by upstream: ${MCUBOOT_UPSTREAM_REV}"
64
+ echo "MCUBOOT_UPSTREAM_REV=${MCUBOOT_UPSTREAM_REV}" >> $GITHUB_ENV
65
+
66
+ - name : Run ncs-upmerge and create sdk-mcuboot upmerge PR
67
+ working-directory : ncs/bootloader/mcuboot
68
+ run : |
69
+ git remote add -f upstream $MCUBOOT_UPSTREAM && git remote add -f origin https://nordicbuilder:${{secrets.NCS_GITHUB_UPMERGE_TOKEN}}@$SDK_MCUBOOT
70
+ git checkout -b upmerge_local
71
+ west ncs-upmerger mcuboot
72
+ git push origin upmerge_local:auto-upmerge/$GITHUB_RUN_ID -u
73
+
74
+ UPSTREAMHASH=${MCUBOOT_UPSTREAM_REV}
75
+ MCUBOOT_PR_URL=$(gh pr create --base $PR_TARGET_BRANCH --title "[nrf mergeup] Merge upstream automatically up to commit $UPSTREAMHASH" --body "Automatic upmerge action" --repo $SDK_MCUBOOT --label "auto-upmerge")
76
+ echo "MCUBOOT_PR_URL=$MCUBOOT_PR_URL" >> $GITHUB_ENV
77
+ echo "Created PR: $MCUBOOT_PR_URL"
78
+
58
79
59
80
- name : create sdk-nrf PR with updated west.yml
60
81
working-directory : ncs/nrf
61
82
run : |
62
83
NEW_REV=$(echo "pull/$(basename $ZEPHYR_PR_URL)/head" | sed 's/\//\\\//g')
84
+ NEW_MCUBOOT_REV=$(echo "pull/$(basename $MCUBOOT_PR_URL)/head" | sed 's/\//\\\//g')
63
85
OLD_REV=$(west list zephyr -f {revision})
86
+ OLD_MCUBOOT_REV=$(west list mcuboot -f {revision})
64
87
git checkout -b upmerge_local
65
88
sed -i "s/revision: $OLD_REV/revision: $NEW_REV/" west.yml
89
+ sed -i "s/revision: $OLD_MCUBOOT_REV/revision: $NEW_MCUBOOT_REV/" west.yml
66
90
git commit -a -m "manifest: Update sdk-zephyr revision (automatic Zephyr upmerge)" -m "Automatically created by Github Action" --signoff
67
91
git push origin upmerge_local:auto-upmerge/$GITHUB_RUN_ID -u
68
- gh pr create --base $PR_TARGET_BRANCH --title "manifest: Update sdk-zephyr revision (automatic upmerge)" --body "Automatic upmerge action" --label "CI-all-test" --label "auto-upmerge"
92
+ gh pr create --base $PR_TARGET_BRANCH --title "manifest: Update revisions of upmerged projects (automatic upmerge)" --body "Automatic upmerge action" --label "CI-all-test" --label "auto-upmerge"
69
93
70
94
failure-notifier :
71
95
runs-on : ubuntu-latest
0 commit comments