Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
upload-cloud

GitHub Action

Snapcraft Action

v1.0.0

Snapcraft Action

upload-cloud

Snapcraft Action

GitHub Action for setting up Snapcraft

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Snapcraft Action

uses: samuelmeuli/action-snapcraft@v1.0.0

Learn more about this action in samuelmeuli/action-snapcraft

Choose a version

Snapcraft Action

GitHub Action for setting up Snapcraft

Usage

Basic

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

Log in

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 }}

Development

Suggestions and contributions are always welcome! Please discuss larger changes via issue before submitting a pull request.