This action uploads ESP-IDF components from a GitHub repository to ESP Component Registry.
This action can be used to upload one or more components to a given namespace
in the registry.
The action requires namespace
and components
inputs to be set. In case of not using OIDC authentication, the api_token
input must be set as well.
This GitHub Action supports two authentication methods for the ESP Component Registry:
OIDC (OpenID Connect) provides enhanced security by eliminating the need to store long-lived secrets. GitHub dynamically generates and provides secure tokens for authentication.
Setup instructions:
- Sign in to the ESP Component Registry
- Click on the dropdown containing your username and navigate to the Permissions page.
- Select the namespace where your component will be uploaded
- If your component doesn't exist yet: Click the
+
button in theComponents
table and create it first
- If your component doesn't exist yet: Click the
- Click on your component name in the
Components
table - Add a trusted uploader by clicking the
+
button in theTrusted Uploaders
table
Trusted Uploader configuration:
Field | Required | Description |
---|---|---|
Repository | ✔ | The GitHub repository in format <organization>/<repository_name> (e.g. espressif/my_component ) |
Branch | ❌ | Specific branch name from which uploads are allowed (e.g. main ) |
Environment | ❌ | GitHub environment name from which uploads are allowed (e.g. production ) |
If the optional Branch
or Environment
fields are not provided, the workflow will be allowed to upload a component version from any branch or environment.
As an alternative, you can authenticate using a ESP Component Registry Token:
- Sign in to the ESP Component Registry
- Click on the dropdown containing your username and navigate to the Tokens page
- Create a new token with appropriate permissions
- Store this token securely in your GitHub repository secrets and use it as
api_token
input
If the version in the manifest file is not already in the registry, this action will upload it, if it is already in the registry, the action will skip the upload silently. Every version of the component can be uploaded to the registry only once and cannot be replaced.
It is recommended to change the version in the manifest only when it's ready to be published.
An alternative supported workflow is to set parameter skip_pre_release
to true
and use pre-release versions (like 1.0.0-dev
) during development
and then change the version to a stable (like 1.0.0
) for release.
If the version of the component is not specified in the manifest file, you can use the version
parameter.
It must be a valid component version optionally prefixed with the character "v".
I.e. versions formatted like v1.2.3
or 1.2.3
are supported.
name: Push component to https://components.espressif.com
on:
push:
jobs:
upload_components:
permissions:
id-token: write # IMPORTANT: Required to generate an OIDC Token
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Upload component to the component registry
uses: espressif/upload-components-ci-action@v2
with:
components: "my_component: ."
namespace: "espressif"
To upload a component named my_component
from the root of the repository,
add the following workflow to the .github/workflows/upload_component.yml
file.
name: Push component to https://components.espressif.com
on:
push:
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Upload component to the component registry
uses: espressif/upload-components-ci-action@v2
with:
components: "my_component: ." # component_name: directory
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
To upload components only on tagged commits, add an on-push-tags rule
to the workflow and set version
input to ${{ github.ref_name }}
.
name: Push component to https://components.espressif.com
on:
push:
tags:
- v*
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Upload component to the component registry
uses: espressif/upload-components-ci-action@v2
with:
components: |
my_component: .
version: ${{ github.ref_name }}
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
If you want to upload multiple components from the same repository, you can specify the ;
or new-line separated list of components in the components
parameter.
The component should be specified as component_name:relative/directory_name
pairs.
If the desired component name matches the directory name, you can omit the component name.
i.e. my_super_component:components/my_component
will upload the component from the components/my_component
directory with the name my_super_component
and components/another_component
will upload the component from the components/another_component
directory with the name another_component
.
name: Push components to https://components.espressif.com
on:
push:
branches:
- main
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Upload components to the component registry
uses: espressif/upload-components-ci-action@v2
with:
components: |
my_super_component:components/my_component
components/another_component
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
name: Push component to https://components.espressif.com
on:
push:
branches:
- main
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
repository: "another/repository"
- name: Save information about repository to the github environment
run:
echo "GITHUB_REPOSITORY_URL=`git config --get remote.origin.url`" >> "$GITHUB_ENV";
echo "GITHUB_COMMIT_SHA=`git rev-parse HEAD`" >> "$GITHUB_ENV";
- name: Upload components to the component registry
uses: espressif/upload-components-ci-action@v2
with:
name: "example"
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
repository_url: ${{ env.GITHUB_REPOSITORY_URL }}
commit_sha: ${{ env.GITHUB_COMMIT_SHA }}
name: Validate component archive
on:
push:
jobs:
validate_components:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Validate component archive
uses: espressif/upload-components-ci-action@v2
with:
components: "my_component: ."
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
dry_run: true
Input | Optional | Default | Description |
---|---|---|---|
namespace | ❌ | Component namespace | |
components | ❌ | Semicolon or new-line separated list of component_name:relative/path pairs. If the desired component name in the registry matches the directory name, the component name can be omitted. For a component in the root of the repo, the name is required. |
|
api_token | ? | API Token for the component. Required unless uploading with a GitHub OIDC Token, in which case it is optional. | |
version | ✔ | Version of the components, if not specified in the manifest. Should be a semver like 1.2.3 or v1.2.3 . The version will be applied to all components. |
|
skip_pre_release | ✔ | False | Set this flag to true , t , yes or 1 to skip pre-release versions. |
dry_run | ✔ | False | Set this flag to true , t , yes or 1 to upload a component for validation only without creating a version in the registry. |
registry_url | ✔ | https://components.espressif.com/ | IDF Component registry URL |
repository_url | ✔ | Current working repository | URL of the repository where component is located. Set to empty string if you don't want to send the information about the repository. |
commit_sha | ✔ | Current commit SHA | Git commit SHA of the component version. Set to empty string if you don't want to send the information about the repository. |
This section provides guidance on migrating from v1 to v2 of this action.
- New
components
input: Replaces thename
anddirectories
inputs with a more flexible format - Deprecated inputs:
name
anddirectories
are deprecated but still partially supported - Removed input:
service_url
has been completely removed (it was previously deprecated in v1 in favor ofregistry_url
) - Enhanced component specification: Components can now be specified with custom names and paths
v1 usage:
- uses: espressif/upload-components-ci-action@v1
with:
name: "my_component"
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
v2 equivalent:
- uses: espressif/upload-components-ci-action@v2
with:
components: "my_component:."
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
v1 usage:
- uses: espressif/upload-components-ci-action@v1
with:
directories: "components/my_component;components/another_component"
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
v2 equivalent:
- uses: espressif/upload-components-ci-action@v2
with:
components: |
components/my_component
components/another_component
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
v1 usage (deprecated):
- uses: espressif/upload-components-ci-action@v1
with:
service_url: "https://components.espressif.com/api"
# ... other inputs
v2 equivalent:
- uses: espressif/upload-components-ci-action@v2
with:
registry_url: "https://components.espressif.com/"
# ... other inputs