Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Github action for publishing snaps

License

NotificationsYou must be signed in to change notification settings

canonical/action-publish

Repository files navigation

snapcraft-publish-action status

Snapcraft Publish Action

This is a Github Action that can be used to publishsnappackages to the Snap Store. In most cases, itwill be used with thesnapcraft-build-action action to build thepackage. The following workflow should be sufficient for Snapcraft 7 or later:

jobs:build:runs-on:ubuntu-lateststeps:    -uses:actions/checkout@v4    -uses:snapcore/action-build@v1id:build    -uses:snapcore/action-publish@v1env:SNAPCRAFT_STORE_CREDENTIALS:${{ secrets.STORE_LOGIN }}with:snap:${{ steps.build.outputs.snap }}release:edge

Alternatively, on Snapcraft 6 and older:

jobs:build:runs-on:ubuntu-lateststeps:    -uses:actions/checkout@v4    -uses:snapcore/action-build@v1id:build    -uses:snapcore/action-publish@v1with:store_login:${{ secrets.STORE_LOGIN }}snap:${{ steps.build.outputs.snap }}release:edge

This will build the project, upload the result to the store, andrelease it to theedge channel. If therelease input parameter isomitted, then the build will not be uploaded but not released.

Store Login

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

As well as preventing the exposure of the password, it also allows thecredentials 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 fileexported.txt containing the login data.The credentials can be restricted further with the--channels and--expires arguments if desired.

In order to make the credentials available to the workflow, theyshould 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 toSTORE_LOGIN (or whatever is referenced in the workflow), and paste the contents ofexported.txt as the value.

Screenshot depicting secrets configuration


[8]ページ先頭

©2009-2025 Movatter.jp