Use goliothctl, the Golioth CLI, from your GitHub Actions
⚠️ This project is considered experimental and is not recommended for production use. Functionality may break at any time.
Parameter | Description | Required |
---|---|---|
apiKey | The API Key generated via goliothctl or web console | Yes |
projectId | Project ID to use | Yes |
If using Create Device action:
Parameter | Description | Required |
---|---|---|
deviceName | Device name | Yes |
psk | Pre-shared key. Used as part of device authentication | No |
pskId | Pre-shared key ID. Used as part of device authentication | No |
deviceTag | Tag used to target a release | No |
If using Create Artifact action:
Parameter | Description | Required |
---|---|---|
file | File to use for artifact | |
artifactVersion | Artifact semantic version | Yes |
releaseArtifact | Artifact to use for release | Yes |
If using Create Release action:
Parameter | Description | Required |
---|---|---|
releaseArtifact | Artifact to use for release | Yes |
releaseVersion | Release version to use for release | Yes |
releaseTag | Tag used to target a release | Yes |
The fastest way to use the CLI:
- name: Setup Golioth CLI
uses: goliothlabs/goliothctl-action@main
with:
apiKey: ${{ secrets.APIKEY }}
projectId: ${{ secrets.PROJECTID }}
- name: List devices
run: goliothctl device list
The primary action only requires a Golioth API Key and Project ID. Refer to the Golioth documentation for to generate an API Key and retrieve a Project ID. We recommend settings these values as repository secrets.
There are 3 additional "create" actions currently supported for devices, artifacts and releases intended to be used as steps in CI.
- name: Checkout
uses: actions/checkout@v4
- name: Use goliothctl
uses: goliothlabs/goliothctl-action@main
with:
apiKey: ${{ secrets.APIKEY }}
projectId: ${{ vars.PROJECTID }}
deviceName: #SOME_NAME#
deviceTag: #SOME_TAG#
file: #SOME_FILE#
artifactVersion: #SOME_VERSION
releaseArtifact: #SOME_ARTIFACT#
releaseVersion: #SOME_VERSION
releaseTag: #SOME_TAG#
Each step is optional, ex. only create a release.
- name: Checkout
uses: actions/checkout@v4
- name: Use goliothctl
uses: goliothlabs/goliothctl-action@main
with:
apiKey: ${{ secrets.APIKEY }}
projectId: ${{ vars.PROJECTID }}
releaseArtifact: #SOME_ARTIFACT#
releaseVersion: #SOME_VERSION
releaseTag: #SOME_TAG#
You can also use the steps as discrete actions if you prefer to be more explicit. Below is the example usage.
- name: Checkout
uses: actions/checkout@v4
- name: Setup goliothctl
uses: goliothlabs/goliothctl-action/actions/setup-goliothctl@main
with:
apiKey: ${{ secrets.APIKEY }}
projectId: ${{ vars.PROJECTID }}
- name: Create device
uses: goliothlabs/goliothctl-action/actions/create-device@main
with:
deviceName: ${{ steps.generator.outputs.name }}
deviceTag: ci
- name: Create artifact
uses: goliothlabs/goliothctl-action/actions/create-artifact@main
with:
file: app_update_thingy91_v1.0.0.bin
version: 1.0.0
- name: Create release
uses: goliothlabs/goliothctl-action/actions/create-release@main
with:
artifact: main
version: 1.0.0
releaseTag: ci