trivial: use github actions to build snaps

This commit is contained in:
Mario Limonciello 2022-10-10 15:54:51 -05:00 committed by Mario Limonciello
parent 2dea742004
commit 32994d236c
3 changed files with 58 additions and 0 deletions

View File

@ -74,6 +74,13 @@ jobs:
echo $GITHUB_WORKSPACE
docker run --privileged -e CI=true -t -v $GITHUB_WORKSPACE:/github/workspace docker.pkg.github.com/fwupd/fwupd/fwupd-${{matrix.os}}:latest
snap:
uses: ./.github/workflows/snap.yml
with:
deploy: ${{ github.event_name }} == "push'
channel: edge
secrets: inherit
macos:
runs-on: macos-12
steps:

13
.github/workflows/snap-stable.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: Publish to snap stable channel
on:
release:
types: [published]
jobs:
snap:
uses: ./.github/workflows/snap.yml
with:
deploy: true
channel: stable
secrets: inherit

38
.github/workflows/snap.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Snap workflow
on:
workflow_call:
inputs:
channel:
required: true
type: string
deploy:
required: true
type: boolean
jobs:
build-snap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: snapcore/action-build@v1
id: snapcraft
- uses: actions/upload-artifact@v3
with:
name: snap
path: ${{ steps.snapcraft.outputs.snap }}
deploy-store:
needs: build-snap
runs-on: ubuntu-latest
if: ${{ inputs.perform_deploy }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: snap
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: ${{ inputs.channel }}