Skip to content

Commit

Permalink
Update snapcraft.yml to include LXD installation and initialization, …
Browse files Browse the repository at this point in the history
…start LXD service, and set version dynamically
  • Loading branch information
maizied.majumder committed Oct 26, 2024
1 parent 62a6dcc commit 3b8b197
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/snapcraft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Snapd, Snapcraft, and LXD
- name: Install Snapd and Snapcraft
run: |
sudo apt update
sudo apt install -y snapd
sudo snap install snapcraft --classic
sudo snap install lxd
sudo lxd init --auto
- name: Start LXD service
run: |
sudo systemctl enable snap.lxd.daemon
sudo systemctl start snap.lxd.daemon
sudo lxd waitready
sudo lxd --version
- name: Set version dynamically
run: |
VERSION="1.0.1-$(git rev-parse --short HEAD)"
sed -i "s/^version: .*/version: \"$VERSION\"/" snapcraft.yaml
- name: Build Snap for ${{ matrix.architecture }}
env:
SNAPCRAFT_BUILD_ENVIRONMENT: lxd
run: snapcraft --use-lxd
run: snapcraft

- name: Login to Snapcraft
env:
Expand All @@ -52,4 +41,4 @@ jobs:
- name: Push Snap to Snap Store
if: success()
run: snapcraft push *.snap --release=stable
run: snapcraft push *.snap --release=stable
2 changes: 1 addition & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ architectures:
- build-on: s390x
- build-on: i386

base: core20
base: core22

parts:
linpad:
Expand Down

0 comments on commit 3b8b197

Please sign in to comment.