Browse Source

Updated building Snap

Lauri Ojansivu 1 week ago
parent
commit
aa681cde88
3 changed files with 43 additions and 20 deletions
  1. 0 18
      releases/snap-build-push-edge-candidate.sh
  2. 33 0
      releases/snap-build.sh
  3. 10 2
      snapcraft.yaml

+ 0 - 18
releases/snap-build-push-edge-candidate.sh

@@ -1,18 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 1 ]
-  then
-    echo "Use: snapcraft login"
-    echo "Then use version number:"
-    echo "  ./releases/snap-build-push-edge-candidate.sh 7.88"
-    exit 1
-fi
-
-sudo apt -y install snapd
-sudo systemctl enable snapd
-sudo systemctl start snapd
-sudo snap install snapcraft --classic
-sudo snap install multipass
-multipass launch --name ubu
-snapcraft
-snapcraft upload --release=candidate,edge wekan_$1_amd64.snap

+ 33 - 0
releases/snap-build.sh

@@ -0,0 +1,33 @@
+#!/bin/bash
+
+echo "First run: snapcraft login"
+echo "Then run this script"
+
+if [[ "$OSTYPE" == "linux-gnu" ]]; then
+	echo "Linux"
+  sudo apt-get -y install snapd
+  sudo systemctl enable snapd
+  sudo systemctl start snapd
+  sudo snap install snapcraft --classic
+  sudo snap install multipass
+  multipass launch --name ubu
+  snapcraft
+  exit;
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+  echo "macOS"
+  brew install snapcraft
+  brew install multipass
+  # Launch multipass VM if needed
+  if ! multipass list | grep -q "ubu.*Running"; then
+    multipass launch --name ubu
+  fi
+  # Build with platform specified for macOS
+  snapcraft --use-lxd --platform=amd64 --build-for=amd64
+  exit;
+else
+  echo "Unknown OS: $OSTYPE"
+  echo "Please install snapcraft and multipass manually."
+  exit;
+fi
+
+

+ 10 - 2
snapcraft.yaml

@@ -13,12 +13,20 @@ description: |
 confinement: strict
 confinement: strict
 grade: stable
 grade: stable
 
 
-# Update platforms format to correct syntax for core24
+# Use platforms instead of architectures for core24 base
 platforms:
 platforms:
   amd64:
   amd64:
-    build-on: amd64
+    build-on: [amd64, arm64]
     build-for: amd64
     build-for: amd64
 
 
+# Remove architectures section (not compatible with core24)
+# architectures: [amd64]
+
+# The previous format was incorrect:
+# architectures:
+#  - build-on: amd64
+#    run-on: amd64
+
 plugs:
 plugs:
   mongodb-plug:
   mongodb-plug:
     interface: content
     interface: content