Git Product home page Git Product logo

action-publish's Introduction

snapcraft-publish-action status

Snapcraft Publish Action

This is a Github Action that can be used to publish snap packages to the Snap Store. In most cases, it will be used with the snapcraft-build-action action to build the package. The following workflow should be sufficient for:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: snapcore/action-build@v1
      id: build
    - uses: snapcore/action-publish@v1
      with:
        store_login: ${{ secrets.STORE_LOGIN }}
        snap: ${{ steps.build.outputs.snap }}
        release: edge

This will build the project, upload the result to the store, and release it to the edge channel. If the release input parameter is omitted, then the build will not be uploaded but not released.

Store Login

In order to upload to the store, the action requires login credentials. Rather than a user name and password, the action expects the data produced by the snapcraft export-login command.

As well as preventing the exposure of the password, it also allows the credentials to be locked down to only the access the action requires:

$ snapcraft export-login --snaps=PACKAGE_NAME \
      --acls package_access,package_push,package_update,package_release \
      exported.txt

This will produce a file exported.txt containing the login data, which should be a multi-line file starting with [login.ubuntu.com]. The credentials can be restricted further with the --channels and --expires arguments if desired.

In order to make the credentials available to the workflow, they should be stored as a repository secret:

  1. choose the "Settings" tab.
  2. choose "Secrets" from the menu on the left.
  3. click "Add a new secret".
  4. set the name to STORE_LOGIN (or whatever is referenced in the workflow), and paste the contents of exported.txt as the value.

Screenshot depicting secrets configuration

action-publish's People

Contributors

jhenstridge avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.