Skip to content

Commit

Permalink
update readme from user testing, remove org-id in sample yml, prefer …
Browse files Browse the repository at this point in the history
…release-only flow
  • Loading branch information
abe-winter committed Aug 25, 2023
1 parent f1bbc8e commit cda6f22
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,32 @@ For more information about the parameters, look at:
- [action.yml](./action.yml)
- `viam module update --help` and `viam module upload --help` in our CLI

Or keep reading for a tutorial.

## Basic usage

- Go to the 'Actions' tab of your repo and create a new workflow
- Paste in the following YAML, then edit all the lines marked with `<--`
- Follow the 'setting CLI config secret' instructions [below](#setting-cli-config-secret)
- Push to a branch or create a release -- your module should upload to our registry with the appropriate version
1. Go to the 'Actions' tab of your repo -> 'create a new workflow' -> 'set up yourself'
1. Paste in the following YAML, then edit all the lines marked with `<--`
1. Follow the 'setting CLI config secret' instructions [below](#setting-cli-config-secret)
1. Push to a branch or create a release -- your module should upload to our registry with the appropriate version

```yml
on:
push:
release:
types: [published]
types: [released]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: build
run: make module.tar.gz # <-- your build command goes here
run: make module.tar.gz # <-- replace this with the command that builds your module
- uses: viamrobotics/upload-module@main
# if: github.event_name == 'release' # <-- once the action is working, uncomment this so you only upload on release
with:
module-path: module.tar.gz
org-id: your-org-id-uuid # <-- replace with your org ID
platform: linux/amd64 # <-- replace with your target architecture, or your module will not deploy
version: ${{ github.event_name == 'release' && github.ref_name || format('0.0.0-{0}.{1}', github.ref_name, github.run_number) }} # <-- see 'Versioning' section below for explanation
cli-config-secret: ${{ secrets.cli_config }}
Expand All @@ -46,6 +48,7 @@ jobs:
Base64-encode your CLI secret by running:
```sh
# run this on the device where you installed the `viam` CLI
cat ~/.viam/cached_cli_config.json | base64
```

Expand Down

0 comments on commit cda6f22

Please sign in to comment.