Skip to content

Commit

Permalink
Update snapcraft.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Maijied authored Oct 25, 2024
1 parent 4d79872 commit 893cfc7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/snapcraft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Snapcraft CI/CD
on:
push:
branches:
- main # Change this to your default branch
- main # Adjust to your default branch if needed
pull_request:
branches:
- main # Change this to your default branch
- main # Adjust to your default branch if needed

jobs:
build-and-publish:
Expand All @@ -19,17 +19,21 @@ jobs:
- name: Install Snapd
run: sudo apt update && sudo apt install -y snapd

- name: Install Snapcraft
- name: Install Snapcraft and LXD
run: |
sudo snap install core
sudo snap install snapcraft --classic
sudo snap install lxd --classic
sudo lxd init --auto # Initialize lxd with default settings
- 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
env:
SNAPCRAFT_BUILD_ENVIRONMENT: lxd # Set Snapcraft to use lxd
run: snapcraft

- name: Login to Snapcraft
Expand Down

0 comments on commit 893cfc7

Please sign in to comment.