Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add an action to update submodules #174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/update_submodules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Update submodules

on:
schedule:
- cron: '0 0 * * SUN' # Sunday midnight
workflow_dispatch: # Or manually

permissions:
contents: write
pull-requests: write

jobs:
update_submodules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Update submodules
uses: espressif/github-actions/update_submodule_versions@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
git-author-name: ${{ secrets.SUBMODULE_UPDATE_AUTHOR_NAME }}
git-author-email: ${{ secrets.SUBMODULE_UPDATE_AUTHOR_EMAIL }}
80 changes: 80 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,36 @@
# The submodule SHA recorded here has to match with SHA, which is presented in git-tree.
# This is checked by CI. Also please don't forget to update the submodule version
# if you are changing the sbom-hash. This is important for SBOM generation.
#
#
# Submodules autoupdate
# ---------------------
# .github/workflows/update_submodules.yml workflow is used to make automatic pull
# requests to update submodules. The workflow uses information from this file to
# determine which submodules should be updated and how.
# For each submodule, several "autoupdate-" entries can be specified, see:
# https://github.com/espressif/github-actions/blob/master/update_submodule_versions/README.md
#

[submodule "libsodium/libsodium"]
path = libsodium/libsodium
url = https://github.com/jedisct1/libsodium.git
# libsodium doesn't tag new releases since 0.18.0, 'stable' branch is considered
# to be the latest stable release. See:
# https://github.com/jedisct1/libsodium/issues/1041#issuecomment-799812417
# However since idf_component.yml had the version already set to 0.20.0,
# we can't update the version automatically (it would be set it back to 0.18.0~n)
# autoupdate = false

[submodule "cbor/tinycbor"]
path = cbor/tinycbor
url = https://github.com/intel/tinycbor.git
autoupdate = true
autoupdate-branch = main
autoupdate-tag-glob = v[0-9]*.[0-9]*.[0-9]*
autoupdate-manifest = cbor/idf_component.yml
autoupdate-ver-regex = v([0-9]+).([0-9]+).([0-9]+)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider keeping some default values for branch, tag-glob and ver-regex fields? If we take most common syntax (e.g., version as vx.y.z) then we can reduce the additional fields specified for all external submodules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept these explicit in order to force the component maintainer to go and check the tag naming pattern the repository actually uses.

Alternatively I could make the action fail if not a single tag with the given naming pattern is found. In that case I'll also make the action run when .gitmodules file is changed, with a --dry-run argument.


[submodule "nghttp/nghttp2"]
path = nghttp/nghttp2
url = https://github.com/nghttp2/nghttp2.git
Expand All @@ -34,6 +57,11 @@
sbom-url = https://github.com/nghttp2/nghttp2
sbom-description = nghttp2 - HTTP/2 C Library and tools
sbom-hash = be0491294a63d891bd12b6b1b7e372a45a5d0ffe
autoupdate = true
autoupdate-branch = master
autoupdate-tag-glob = v[0-9]*.[0-9]*.[0-9]*
autoupdate-manifest = nghttp/idf_component.yml
autoupdate-ver-regex = v([0-9]+).([0-9]+).([0-9]+)

[submodule "expat/expat"]
path = expat/expat
Expand All @@ -44,6 +72,11 @@
sbom-url = https://github.com/libexpat/libexpat/
sbom-description = Fast streaming XML parser written in C99
sbom-hash = 454c6105bc2d0ea2521b8f8f7a5161c2abd8c386
autoupdate = true
autoupdate-branch = master
autoupdate-tag-glob = R_[0-9]*_[0-9]*_[0-9]*
autoupdate-manifest = expat/idf_component.yml
autoupdate-ver-regex = R_([0-9]+)_([0-9]+)_([0-9]+)

[submodule "coap/libcoap"]
path = coap/libcoap
Expand All @@ -54,13 +87,33 @@
sbom-url = https://github.com/obgm/libcoap
sbom-description = A CoAP (RFC 7252) implementation in C
sbom-hash = c694baead2f9b408a7598e0b85c2f257ea8c9651
autoupdate = true
autoupdate-branch = develop
autoupdate-tag-glob = v[0-9]*.[0-9]*.[0-9]*
autoupdate-include-lightweight = true
autoupdate-manifest = coap/idf_component.yml
autoupdate-ver-regex = v([0-9]+).([0-9]+).([0-9]+)

[submodule "usb/usb_host_uvc/libuvc"]
path = usb/usb_host_uvc/libuvc
url = https://github.com/libuvc/libuvc.git
autoupdate = true
autoupdate-branch = master
autoupdate-tag-glob = v[0-9]*.[0-9]*.[0-9]*
autoupdate-include-lightweight = true
# Not updating the manifest automatically,
# since the component version is ahead of the upstream version

[submodule "eigen/eigen"]
path = eigen/eigen
url = https://gitlab.com/libeigen/eigen.git
autoupdate = true
autoupdate-branch = 3.4
autoupdate-tag-glob = [0-9]*.[0-9]*.[0-9]*
autoupdate-include-lightweight = true
autoupdate-manifest = eigen/idf_component.yml
autoupdate-ver-regex = ([0-9]+).([0-9]+).([0-9]+)

[submodule "fmt/fmt"]
path = fmt/fmt
url = https://github.com/fmtlib/fmt.git
Expand All @@ -70,13 +123,29 @@
sbom-url = https://github.com/fmtlib/fmt/
sbom-description = A modern formatting library
sbom-hash = a33701196adfad74917046096bf5a2aa0ab0bb50
autoupdate = true
autoupdate-branch = master
autoupdate-tag-glob = [0-9]*.[0-9]*.[0-9]*
autoupdate-include-lightweight = true
autoupdate-manifest = fmt/idf_component.yml
autoupdate-ver-regex = ([0-9]+).([0-9]+).([0-9]+)

[submodule "esp_delta_ota/detools"]
path = esp_delta_ota/detools
url = https://github.com/eerimoq/detools.git
# not updating automatically, as this is not an upstream repo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do use source from this repository in our component build. We should add this component in the auto update list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mahavirj I can add it, but how is the version of the component related to the version of detools? It looks like they aren't related.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are not related. Our component follows its own versioning policy here. We can handle the update for this case on-demand basis.

# but a tool used by the component

[submodule "quirc/quirc"]
path = quirc/quirc
url = https://github.com/dlbeer/quirc.git
autoupdate = true
autoupdate-branch = master
autoupdate-tag-glob = v[0-9]*.[0-9]*
autoupdate-include-lightweight = true
autoupdate-manifest = quirc/idf_component.yml
autoupdate-ver-regex = v([0-9]+).([0-9]+)

[submodule "zlib/zlib"]
path = zlib/zlib
url = https://github.com/madler/zlib.git
Expand All @@ -86,6 +155,11 @@
sbom-url = https://github.com/madler/zlib.git
sbom-description = A massively spiffy yet delicately unobtrusive compression library
sbom-hash = 04f42ceca40f73e2978b50e93806c2a18c1281fc
autoupdate = true
autoupdate-branch = master
autoupdate-tag-glob = v[0-9]*.[0-9]*.[0-9]*
autoupdate-manifest = zlib/idf_component.yml
autoupdate-ver-regex = v([0-9]+).([0-9]+).([0-9]+)

[submodule "libpng/libpng"]
path = libpng/libpng
Expand All @@ -96,3 +170,9 @@
sbom-url = https://github.com/glennrp/libpng.git
sbom-description = Portable Network Graphics support, official PNG reference library
sbom-hash = 07b8803110da160b158ebfef872627da6c85cbdf
autoupdate = true
autoupdate-branch = libpng16
autoupdate-include-lightweight = true
autoupdate-tag-glob = v[0-9]*.[0-9]*.[0-9]*
autoupdate-manifest = libpng/idf_component.yml
autoupdate-ver-regex = v([0-9]+).([0-9]+).([0-9]+)
Loading