Skip to content

Commit e855871

Browse files
Merge branch 'aws:main' into updateSubmoduleRemoveOTA
2 parents 33097f7 + 87ca28c commit e855871

File tree

4 files changed

+50
-23
lines changed

4 files changed

+50
-23
lines changed

.github/workflows/tag-and-zip.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,27 @@ jobs:
1616
runs-on: ubuntu-20.04
1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
with:
2121
ref: ${{ github.event.inputs.commit_id }}
2222
- name: Configure git identity
2323
run: |
2424
git config --global user.name "Release Workflow"
2525
- name: Tag Commit and Push to remote
26+
env:
27+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
2628
run: |
27-
git tag ${{ github.event.inputs.version_number }} -a -m "AWS IoT Device SDK for Embedded C version ${{ github.event.inputs.version_number }}"
29+
git tag "$VERSION_NUMBER" -a -m "AWS IoT Device SDK for Embedded C version $VERSION_NUMBER"
2830
git push origin --tags
2931
- name: Verify tag on remote
32+
env:
33+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
34+
COMMIT_ID: ${{ github.event.inputs.commit_id }}
3035
run: |
31-
git tag -d ${{ github.event.inputs.version_number }}
36+
git tag -d "$VERSION_NUMBER"
3237
git remote update
33-
git checkout tags/${{ github.event.inputs.version_number }}
34-
git diff ${{ github.event.inputs.commit_id }} tags/${{ github.event.inputs.version_number }}
38+
git checkout tags/"$VERSION_NUMBER"
39+
git diff "$COMMIT_ID" tags/"$VERSION_NUMBER"
3540
create-zip:
3641
needs: tag-commit
3742
name: Create ZIP and verify package for release asset.
@@ -40,7 +45,7 @@ jobs:
4045
- name: Install ZIP tools
4146
run: sudo apt-get install zip unzip
4247
- name: Checkout code
43-
uses: actions/checkout@v2
48+
uses: actions/checkout@v4
4449
with:
4550
ref: ${{ github.event.inputs.commit_id }}
4651
path: aws-iot-device-sdk-embedded-C
@@ -50,22 +55,28 @@ jobs:
5055
cd aws-iot-device-sdk-embedded-C
5156
git submodule update --init --checkout --recursive
5257
- name: Create ZIP
58+
env:
59+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
5360
run: |
54-
zip -r aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}.zip aws-iot-device-sdk-embedded-C -x "*.git*"
61+
zip -r aws-iot-device-sdk-embedded-C-$"VERSION_NUMBER".zip aws-iot-device-sdk-embedded-C -x "*.git*"
5562
ls ./
5663
- name: Validate created ZIP
64+
env:
65+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
5766
run: |
5867
mkdir zip-check
59-
mv aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}.zip zip-check
68+
mv aws-iot-device-sdk-embedded-C-"$VERSION_NUMBER".zip zip-check
6069
cd zip-check
61-
unzip aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}.zip -d aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}
62-
ls aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}
63-
diff -r -x "*.git*" aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}/aws-iot-device-sdk-embedded-C/ ../aws-iot-device-sdk-embedded-C/
70+
unzip aws-iot-device-sdk-embedded-C-"$VERSION_NUMBER".zip -d aws-iot-device-sdk-embedded-C-"$VERSION_NUMBER"
71+
ls aws-iot-device-sdk-embedded-C-"$VERSION_NUMBER"
72+
diff -r -x "*.git*" aws-iot-device-sdk-embedded-C-"$VERSION_NUMBER"/aws-iot-device-sdk-embedded-C/ ../aws-iot-device-sdk-embedded-C/
6473
cd ../
6574
- name : Build Check Demos
75+
env:
76+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
6677
run: |
6778
sudo apt-get install -y libmosquitto-dev
68-
cd zip-check/aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}/aws-iot-device-sdk-embedded-C/
79+
cd zip-check/aws-iot-device-sdk-embedded-C-"$VERSION_NUMBER"/aws-iot-device-sdk-embedded-C/
6980
cmake -S . -B build/ \
7081
-G "Unix Makefiles" \
7182
-DBUILD_DEMOS=1 \
@@ -89,8 +100,10 @@ jobs:
89100
make -C build/ help | grep demo | tr -d '. ' | xargs make -C build/ -j8
90101
make -C demos/jobs/jobs_demo_mosquitto -j8
91102
- name : Build Check Tests
103+
env:
104+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
92105
run: |
93-
cd zip-check/aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}/aws-iot-device-sdk-embedded-C/
106+
cd zip-check/aws-iot-device-sdk-embedded-C-"$VERSION_NUMBER"/aws-iot-device-sdk-embedded-C/
94107
rm -rf ./build
95108
cmake -S . -B build/ \
96109
-G "Unix Makefiles" \
@@ -105,8 +118,10 @@ jobs:
105118
-DCLIENT_IDENTIFIER="ci-identifier"
106119
make -C build/ all -j8
107120
- name: Run Unit Tests
121+
env:
122+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
108123
run: |
109-
cd zip-check/aws-iot-device-sdk-embedded-C-${{ github.event.inputs.version_number }}/aws-iot-device-sdk-embedded-C/build/
124+
cd zip-check/aws-iot-device-sdk-embedded-C-"$VERSION_NUMBER"/aws-iot-device-sdk-embedded-C/build/
110125
ctest -E system --output-on-failure
111126
cd ..
112127
- name: Create artifact of ZIP

.github/workflows/update-submodules.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ jobs:
2525
run: |
2626
git config --global user.name "Submodule Updater"
2727
- name: Update the submodules
28+
env:
29+
ALLOWED: ${{ github.event.inputs.allowed }}
2830
run: |
29-
libs=$(find libraries/standard libraries/aws -maxdepth 1 -mindepth 1 | grep "${{ github.event.inputs.allowed }}")
31+
libs=$(find libraries/standard libraries/aws -maxdepth 1 -mindepth 1 | grep "$ALLOWED")
3032
git submodule update --remote $libs
3133
- name: Commit changes and Push to remote
3234
run: |
@@ -38,5 +40,6 @@ jobs:
3840
- name: Raise a Pull-Request
3941
env:
4042
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
BRANCH: ${{ github.event.inputs.branch }}
4144
run: |
42-
gh pr create --base ${{ github.event.inputs.branch }} --title 'Update library submodules to the latest' --body 'Update library submodules to the latest'
45+
gh pr create --base "$BRANCH" --title 'Update library submodules to the latest' --body 'Update library submodules to the latest'

.github/workflows/upload-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
draft: false
3232
prerelease: false
3333
- name: Download ZIP artifact
34-
uses: dawidd6/action-download-artifact@v2
34+
uses: dawidd6/action-download-artifact@v6
3535
with:
3636
github_token: ${{secrets.GITHUB_TOKEN}}
3737
# Required, workflow file name or ID

.github/workflows/version-updater.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,35 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout code
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323
with:
2424
ref: ${{ github.event.inputs.branch }}
2525
- name: Configure git identity
2626
run: |
2727
git config --global user.name "Version Updater"
2828
- name: Update source files with new version
29+
env:
30+
OLD_VERSION_NUMBER: ${{ github.event.inputs.old_version_number }}
31+
NEW_VERSION_NUMBER: ${{ github.event.inputs.new_version_number }}
2932
run: |
30-
grep -ilr ${{ github.event.inputs.old_version_number }} . | grep -Ev ".git|CHANGELOG.md|README.md|CONTRIBUTING.md" | xargs sed -i s/${{ github.event.inputs.old_version_number }}/${{ github.event.inputs.new_version_number }}/g
33+
grep -ilr "$OLD_VERSION_NUMBER" . | grep -Ev ".git|CHANGELOG.md|README.md|CONTRIBUTING.md" | xargs sed -i s/"$OLD_VERSION_NUMBER"/"$NEW_VERSION_NUMBER"/g
3134
- name: Commit changes and Push to remote
35+
env:
36+
OLD_VERSION_NUMBER: ${{ github.event.inputs.old_version_number }}
37+
NEW_VERSION_NUMBER: ${{ github.event.inputs.new_version_number }}
3238
run: |
33-
git checkout -b updater-job/update-to-${{ github.event.inputs.new_version_number }}
34-
git commit -am 'Update versioning in file from ${{ github.event.inputs.old_version_number }} to ${{ github.event.inputs.new_version_number }}'
35-
git push --set-upstream origin updater-job/update-to-${{ github.event.inputs.new_version_number }}
39+
git checkout -b updater-job/update-to-"$NEW_VERSION_NUMBER"
40+
git commit -am "Update versioning in file from "$OLD_VERSION_NUMBER" to $NEW_VERSION_NUMBER"
41+
git push --set-upstream origin updater-job/update-to-"$NEW_VERSION_NUMBER"
3642
- name: Raise a Pull-Request
3743
env:
3844
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
OLD_VERSION_NUMBER: ${{ github.event.inputs.old_version_number }}
46+
NEW_VERSION_NUMBER: ${{ github.event.inputs.new_version_number }}
47+
BRANCH: ${{ github.event.inputs.branch }}
3948
run: |
4049
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 23F3D4EA75716059
4150
sudo apt-add-repository https://cli.github.com/packages
4251
sudo apt update
4352
sudo apt-get install gh
44-
gh pr create --base ${{ github.event.inputs.branch }} --title 'Update source file versioning to ${{ github.event.inputs.new_version_number }}' --body 'Updater-Job: PR to update versioning in source files from ${{ github.event.inputs.old_version_numver }} to ${{ github.event.inputs.new_version_number }}'
53+
gh pr create --base "$BRANCH" --title "Update source file versioning to $NEW_VERSION_NUMBER" --body "Updater-Job: PR to update versioning in source files from $OLD_VERSION_NUMBER to $NEW_VERSION_NUMBER"

0 commit comments

Comments
 (0)