Skip to content

Commit a9d9238

Browse files
Updated SDK Bump CI Inputs (#6)
1 parent bc65be7 commit a9d9238

1 file changed

Lines changed: 58 additions & 21 deletions

File tree

.github/workflows/sdk-submodule-bump.yaml

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ name: SDK Submodule Bump
33
on:
44
workflow_dispatch:
55
inputs:
6+
sisdk-version:
7+
description: 'SiSDK version'
8+
required: true
9+
type: choice
10+
options:
11+
- 2025.12
12+
- 2026.6
613
sisdk-build-number:
714
description: 'SDK (sisdk-prerelease and wiseconnect-prerelease) Build Number to bump to (e.g., 1355)'
815
required: true
@@ -12,11 +19,39 @@ jobs:
1219
bump-sdk-submodules:
1320
runs-on: ubuntu-latest
1421
steps:
22+
- name: Resolve SiSDK version and tag
23+
id: resolve_inputs
24+
shell: bash
25+
run: |
26+
set -euo pipefail
27+
28+
SISDK_VERSION="${{ inputs.sisdk-version }}"
29+
SISDK_BUILD_NUMBER="${{ inputs.sisdk-build-number }}"
30+
31+
# Input validation - ensure build number contains only digits
32+
if [[ ! "$SISDK_BUILD_NUMBER" =~ ^[0-9]+$ ]]; then
33+
echo "Error: Build number must contain only digits. Received: $SISDK_BUILD_NUMBER"
34+
exit 1
35+
fi
36+
37+
SDK_TAG="v${SISDK_VERSION}-build.${SISDK_BUILD_NUMBER}"
38+
PR_BRANCH="automation/update_sdk_submodules_${SISDK_VERSION//./_}_${SISDK_BUILD_NUMBER}"
39+
40+
echo "sisdk_version=$SISDK_VERSION" >> "$GITHUB_OUTPUT"
41+
echo "sisdk_build_number=$SISDK_BUILD_NUMBER" >> "$GITHUB_OUTPUT"
42+
echo "sdk_tag=$SDK_TAG" >> "$GITHUB_OUTPUT"
43+
echo "pr_branch=$PR_BRANCH" >> "$GITHUB_OUTPUT"
44+
45+
echo "Selected SiSDK version: $SISDK_VERSION"
46+
echo "Selected build number: $SISDK_BUILD_NUMBER"
47+
echo "Resolved SDK tag: $SDK_TAG"
48+
echo "Resolved PR branch: $PR_BRANCH"
49+
1550
- name: Checkout repository
1651
uses: actions/checkout@v6
1752
with:
1853
submodules: false
19-
ref: release_2.8-1.5
54+
ref: ${{ github.ref }}
2055
persist-credentials: false
2156

2257
- name: Mark repository as safe for Git
@@ -27,32 +62,30 @@ jobs:
2762
- name: Bump SDK submodules
2863
shell: bash
2964
run: |
30-
set -euo pipefail
31-
32-
SISDK_BUILD_NUMBER="${{ inputs.sisdk-build-number }}"
33-
34-
# Input validation - ensure build number contains only digits
35-
if [[ ! "$SISDK_BUILD_NUMBER" =~ ^[0-9]+$ ]]; then
36-
echo "Error: Build number must contain only digits. Received: $SISDK_BUILD_NUMBER"
37-
exit 1
38-
fi
39-
40-
echo "Bumping simplicity_sdk to build number: $SISDK_BUILD_NUMBER"
65+
set -euo pipefail
66+
SISDK_VERSION="${{ steps.resolve_inputs.outputs.sisdk_version }}"
67+
SISDK_BUILD_NUMBER="${{ steps.resolve_inputs.outputs.sisdk_build_number }}"
68+
SDK_TAG="${{ steps.resolve_inputs.outputs.sdk_tag }}"
69+
70+
echo "Bumping simplicity_sdk and wifi_sdk"
71+
echo "SiSDK version: $SISDK_VERSION"
72+
echo "Build number: $SISDK_BUILD_NUMBER"
73+
echo "Tag: $SDK_TAG"
4174
4275
git submodule update --init third_party/simplicity_sdk
4376
git submodule update --init third_party/wifi_sdk
4477
cd third_party/simplicity_sdk
4578
git fetch origin
46-
git checkout v2025.12-build.$SISDK_BUILD_NUMBER
79+
git checkout "$SDK_TAG"
80+
4781
cd ../wifi_sdk
4882
git fetch origin
49-
git checkout v2025.12-build.$SISDK_BUILD_NUMBER
83+
git checkout "$SDK_TAG"
5084
cd ../..
5185
5286
echo "Updating .gitmodules tags..."
5387
# Update the tags in .gitmodules
54-
sed -i "s|^\(\s*tag = \)v2025\.12-build\.[0-9]*$|\1v2025.12-build.$SISDK_BUILD_NUMBER|g" .gitmodules
55-
88+
sed -i "s|^\(\s*tag = \)\(v2025\.12\|v2026\.6\)-build\.[0-9]*$|\1\2-build.$SISDK_BUILD_NUMBER|g" .gitmodules
5689
# Display the updated .gitmodules content
5790
echo "Updated .gitmodules:"
5891
cat .gitmodules
@@ -73,10 +106,14 @@ jobs:
73106
- name: Create Pull Request
74107
uses: peter-evans/create-pull-request@v8
75108
with:
76-
branch: automation/update_sdk_submodules
77-
base: release_2.8-1.5
78-
title: "Update SDK submodules on release_2.8-1.5"
79-
body: |
80-
This PR updates the simplicity_sdk and wifi_sdk submodules to the ${{ inputs.sisdk-build-number }} on the release_2.8-1.5 branch.
109+
branch: ${{ steps.resolve_inputs.outputs.pr_branch }}
110+
base: ${{ github.ref_name }}
111+
title: "Update SDK submodules to ${{ steps.resolve_inputs.outputs.sdk_tag }} on ${{ github.ref_name }}"
112+
body: |
113+
This PR updates the simplicity_sdk and wifi_sdk submodules to `${{ steps.resolve_inputs.outputs.sdk_tag }}` on the `${{ github.ref_name }}` branch.
114+
115+
- SiSDK version: `${{ steps.resolve_inputs.outputs.sisdk_version }}`
116+
- Build number: `${{ steps.resolve_inputs.outputs.sisdk_build_number }}`
117+
- Resolved tag: `${{ steps.resolve_inputs.outputs.sdk_tag }}`
81118
82119
token: ${{ steps.generate_token.outputs.token }}

0 commit comments

Comments
 (0)