snap¶
The snap workflow is the main entry point of the snap CI.
It calls the build,
test
and publish workflows
as an integrated and coherent sequence.
By default it:
builds the snap,
installs it and calls
snap infoon it,publishes it to the Snap Store, either to
latest/edgeon pushes or tolatest/candidateon tags.
The publish step only runs on push, workflow_dispatch and schedule events,
and only when the snapstore-login secret is defined.
On pull requests, the workflow only builds and tests the snap.
Usage¶
jobs:
snap:
permissions:
contents: read
uses: canonical/robotics-actions-workflows/.github/workflows/snap.yaml@main
secrets:
snapstore-login: ${{ secrets.SNAPSTORE_LOGIN }}
Inputs¶
Input |
Type |
Default |
Required |
Description |
|---|---|---|---|---|
|
boolean |
|
no |
Whether to delete the build artifacts after the run. Requires |
|
string |
|
no |
The branch to checkout. |
|
string |
|
no |
The LXD image to run the snap tests in, for example |
|
string |
|
no |
The runner(s) to use. Accepts a JSON list, for example |
|
string |
|
no |
The argument to pass to |
|
string |
|
no |
A bash test script to run against the snap. |
|
string |
|
no |
Snap Store channel risk used for publication. Defaults to |
|
string |
|
no |
Snap Store channel track used for publication. |
|
string |
|
no |
The arguments to pass to |
|
string |
|
no |
The channel from which to install Snapcraft. |
|
boolean |
|
no |
Whether to enable Snapcraft experimental extensions. |
|
string |
|
no |
The path where to execute Snapcraft. Accepts a JSON list to build multiple snaps, for example |
Secrets¶
Secret |
Required |
Description |
|---|---|---|
|
no |
Snap Store credential (see |
Outputs¶
The workflow declares no workflow outputs. Its outcomes are:
a workflow artifact per built snap, named
workflow-build-snap-<snap-file-name>-<branch>, retained for 10 days unlesscleanupis enabled;a published snap revision on the configured channel when the publish step runs.
Permissions¶
contents: readactions: writeon the cleanup job, only whencleanupis enabled.