Update and manage modules you created | Viam Documentation

Update and manage modules you created

After you create and upload a module, you can release new versions, pin machines to a specific version, set a minimum viam-server version, change visibility, deprecate, or delete the module.

Update a module

Once your module is in the registry, there are two ways to update it:

Update automatically from a GitHub repo with cloud build

Use GitHub Actions to automatically build and deploy your new module version when you create a new release in GitHub:

  1. Edit your module code and update the meta.json file if needed.
    For example, if you’ve changed the module’s functionality, update the description in the meta.json file.

Important

Make sure the url field contains the URL of the GitHub repo that contains your module code.
This field is required for cloud build to work.

  1. Push your changes to your module GitHub repository.

Tip

If you used viam module generate to create your module and enabled cloud build, and you followed all the steps to deploy with cloud build including adding API keys for the build action, all you need to do to trigger a new build is publish a release in GitHub as you did when you first published the module.

  1. If you did not use the Viam CLI generator and enable cloud build, you can set up one of the following GitHub Actions up manually:

The build-action GitHub action provides a cross-platform build setup for multiple platforms: x86, ARM Linux, and macOS.

In your repository, create a workflow file called build.yml in the .github/workflows directory:

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: viamrobotics/build-action@v1
        with:
          version: ${{ github.ref_name }}
          ref: ${{ github.sha }}
          key-id: ${{ secrets.viam_key_id }}
          key-value: ${{ secrets.viam_key_value }}
          token: ${{ github.token }} # only required for private git repos

The build-action GitHub action relies on a build command that you need to specify in the meta.json file.
At the end of your meta.json, add the build configuration:


Cloud build configuration attributes
Attribute Inclusion Description
"setup" Optional Command to run for setting up the build environment.
"build" Required Command to run to build the module tarball.
"path" Optional Path to the build module tarball.
"arch" Required Array of architectures to build for. For more information see Supported platforms for automatic updates.
"darwin_deps" Required Array of homebrew dependencies for Darwin builds. Explicitly pass [] for empty. Default: `[