You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Snapcraft Action
v1.0.0
GitHub Action for setting up Snapcraft
To use this action, add the following step to your workflow:
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
A full example:
name: My workflow
on: push
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
# You can now run Snapcraft shell commands
- name: Use Snapcraft
run: snapcraft --help
This action can also log you in to the Snap Store. For this to work, you need an Ubuntu One account.
You will also need a Snap Store login token. To obtain one, run the following command on your machine:
snapcraft export-login --snaps SNAP_NAME --channels edge -
Copy that token and add it as a secret to GitHub Actions. You can do this in your GitHub repository under Settings → Secrets. The secret must be called snapcraft_token
.
Finally, add the following option to your workflow step:
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
with:
snapcraft_token: ${{ secrets.snapcraft_token }}
Suggestions and contributions are always welcome! Please discuss larger changes via issue before submitting a pull request.