Skip to content

Commit

Permalink
Refactor snapcraft.yaml to use the latest version of the snapcore/sna…
Browse files Browse the repository at this point in the history
…pcraft-action GitHub Action
  • Loading branch information
maizied.majumder committed Oct 25, 2024
1 parent a2e0d8b commit 441ffb2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 48 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/snapcraft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Snapcraft
uses: diddlesnaps/action-snapcraft@v1
with:
version: 'latest/beta' # Use the latest Snapcraft 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
run: snapcraft

- name: Login to Snapcraft
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS || '' }}
run: echo "${SNAPCRAFT_STORE_CREDENTIALS}" | snapcraft login --with -

- name: Push Snap to Snap Store
run: snapcraft push *.snap --release=stable
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Snapcraft
uses: snapcore/snapcraft-action@v1
with:
version: 'latest/beta' # Use the latest Snapcraft 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
run: snapcraft

- name: Login to Snapcraft
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
echo "${SNAPCRAFT_STORE_CREDENTIALS}" | snapcraft login --with -
- name: Push Snap to Snap Store
run: snapcraft push *.snap --release=stable
34 changes: 11 additions & 23 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,40 @@
name: linpad
version: "1.0.1-79b3499"
version: "1.0.1-$(git rev-parse --short HEAD)"
summary: "Linpad text editor for Ubuntu with enhanced features"
description: |
Linpad is a lightweight text editor designed for Ubuntu. It includes file handling, syntax highlighting, dark mode, zoom, word count, and replace functionality.
grade: stable # Use `devel` for development versions
confinement: strict # `strict` confinement for security
grade: stable
confinement: strict

base: core20 # Snapcraft base for compatibility with most libraries
compression: lzo # Alternative compression to prevent xz issues

architectures:
- build-on: amd64
- build-on: arm64
- build-on: armhf
- build-on: ppc64el
- build-on: s390x
- build-on: riscv64
base: core20

parts:
linpad:
plugin: python # Using the Python plugin for dependencies
plugin: python
source: .
stage-packages:
- python3-tk # Required for Tkinter
- python3-tk # Ensure tkinter is included
- python3
- libsqlite3-dev # Additional dependency
- libssl-dev # Additional dependency
- libsqlite3-dev
- libssl-dev
override-build: |
snapcraftctl build
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/bin
cp linpad.py $SNAPCRAFT_PART_INSTALL/usr/bin/linpad
chmod +x $SNAPCRAFT_PART_INSTALL/usr/bin/linpad
prime: # Exclude unnecessary files
- "-usr/lib/libBLTlite.2.5.so.8.6" # Exclude unused library as per warning
apps:
linpad:
command: usr/bin/linpad # Entry command for the Linpad app
plugs: # Required permissions
command: usr/bin/linpad
plugs:
- home
- desktop
- desktop-legacy
- x11
- wayland
- network
- network-bind
environment: # Set environment variables for app runtime
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8

4 changes: 2 additions & 2 deletions usr/share/applications/linpad.desktop
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Desktop Entry]
Version=1.0
Name=Linpad
Exec=/usr/bin/linpad
Icon=linpad
Exec=linpad
Icon=/usr/local/bin/linpad/lin_logo.webp
Type=Application
Categories=TextEditor;Utility;
Terminal=false

0 comments on commit 441ffb2

Please sign in to comment.