Skip to content

Commit

Permalink
Update snapcraft.yml to include build matrix and login to Snapcraft b…
Browse files Browse the repository at this point in the history
…efore pushing the Snap to the Snap Store
  • Loading branch information
maizied.majumder committed Oct 25, 2024
1 parent 789ebb4 commit 820319b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/snapcraft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
jobs:
build-and-publish:
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [amd64, arm64, armhf, ppc64el, s390x, i386]

steps:
- name: Checkout repository
Expand All @@ -27,10 +30,17 @@ jobs:
VERSION="1.0.1-$(git rev-parse --short HEAD)"
sed -i "s/^version: .*/version: \"$VERSION\"/" snapcraft.yaml
- name: Build Snap with Host Provider
run: snapcraft --use-lxd # Ensures it runs directly on the host
- name: Build Snap for ${{ matrix.architecture }}
env:
SNAPCRAFT_BUILD_ENVIRONMENT: lxd
run: snapcraft --target-arch=${{ matrix.architecture }} --use-lxd

- name: Push Snap to Snap Store
- name: Login to Snapcraft
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: snapcraft push *.snap --release=stable
run: |
echo "${SNAPCRAFT_STORE_CREDENTIALS}" | snapcraft login --with -
- name: Push Snap to Snap Store
if: success()
run: snapcraft push *.snap --release=stable
10 changes: 9 additions & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ description: |
grade: stable
confinement: strict

architectures:
- build-on: amd64
- build-on: arm64
- build-on: armhf
- build-on: ppc64el
- build-on: s390x
- build-on: i386

base: core20

parts:
linpad:
plugin: python
source: .
stage-packages:
- python3-tk # Ensure tkinter is included
- python3-tk
- python3
- libsqlite3-dev
- libssl-dev
Expand Down

0 comments on commit 820319b

Please sign in to comment.