How to Upload from GitHub Actions

If you host your component source on GitHub, you can automate uploads so that new versions are published whenever you push a tag or merge to your main branch.

There are two ways to authenticate GitHub Actions with the ESP Component Registry:

  • OIDC (recommended): GitHub proves the identity of your workflow to the registry directly. No secrets to store or rotate.

  • API token: Store a registry API token as a GitHub secret and pass it to the action. Simpler to set up, but you are responsible for keeping the token secure and rotating it.

Option 2: API token

If you cannot use OIDC (for example, self-hosted runners without OIDC support), you can authenticate with an API token instead.

  1. Log in to the registry and copy your API token (see How to Authenticate for Publishing).

  2. Add the token as a GitHub Actions secret (for example, IDF_COMPONENT_API_TOKEN).

  3. Pass it to the action:

name: Upload component
on:
  push:
    branches: [ main ]

jobs:
  upload_components:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: espressif/upload-components-ci-action@v2
        with:
          components: "my_component: ."
          namespace: "my_namespace"
          api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}