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 building Snapcraft projects

License

NotificationsYou must be signed in to change notification settings

snapcore/action-build

 
 

Repository files navigation

snapcraft-build-action status

Snapcraft Build Action

This is a Github Action that can be used to build aSnapcraft project. For most projects, thefollowing workflow should be sufficient:

jobs:build:runs-on:ubuntu-lateststeps:    -uses:actions/checkout@v4    -uses:snapcore/action-build@v1

This will install and configure LXD and Snapcraft, then invokesnapcraft to build the project.

On success, the action will set thesnap output parameter to thepath of the built snap. This can be used to save it as an artifact ofthe workflow:

...    -uses:snapcore/action-build@v1id:snapcraft    -uses:actions/upload-artifact@v3with:name:snappath:${{ steps.snapcraft.outputs.snap }}

Alternatively, it could be used to perform further testing on the built snap:

    -run:|        sudo snap install --dangerous ${{ steps.snapcraft.outputs.snap }}        # do something with the snap

The action can also be chained withsnapcore/action-publish@v1to automatically publish builds to the Snap Store.

Action inputs

path

If your Snapcraft project is not located in the root of the workspace,you can specify an alternative location via thepath inputparameter:

...    -uses:snapcore/action-build@v1with:path:path-to-snapcraft-project

build-info

By default, the action will tell Snapcraft to include informationabout the build in the resulting snap, in the form of thesnap/snapcraft.yaml andsnap/manifest.yaml files. Among otherthings, these are used by the Snap Store's automatic securityvulnerability scanner to check whether your snap includes files fromvulnerable versions of Ubuntu packages.

This can be turned off by setting thebuild-info parameter tofalse.

snapcraft-channel

By default, the action will install Snapcraft from the stablechannel. If your project relies on a feature not found in the stableversion of Snapcraft, then thesnapcraft-channel parameter can beused to select a different channel.

snapcraft-args

Thesnapcraft-args parameter can be used to pass additionalarguments to Snapcraft. This is primarily intended to allow the useof experimental features by passing--enable-experimental-*arguments to Snapcraft.

ua-token

Theua-token parameter can be used to tell Snapcraft to attach an UbuntuAdvantage (UA) token inside the build environment. Snapcraft will ensurethe token is detached before exiting, but be warned that it is possiblesome failures may prevent detaching (e.g. aborted jobs).

In order to make the UA token available to the workflow, it should be storedas 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 toUA_TOKEN (or whatever is referenced in the workflow),and paste the UA token as the value.

Note that repository secrets are not available to workflows triggeredby pull requests to public repositories.

An example workflow with UA token stored as secretUA_TOKEN:

...    -uses:snapcore/action-build@v1with:ua-token:${{ secrets.UA_TOKEN }}

About

A Github action for building Snapcraft projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript96.2%
  • C1.9%
  • Meson1.9%

[8]ページ先頭

©2009-2025 Movatter.jp