Skip to content

Commit

Permalink
Merge pull request #5 from ErikKalkoken/improve-build-process
Browse files Browse the repository at this point in the history
Improve build process
  • Loading branch information
ErikKalkoken authored Jul 29, 2024
2 parents cc3bc3b + 6ccb11c commit e2538b5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
- name: Package Fyne app
run: fyne package -os linux

- name: Build tools
run: go build ./tools/readmetadata

- name: Set version
run: |
VERSION=${{ github.ref_name }}
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ tools/generate_json/generate_json
test*.json
temp.*/
profile*.gif
out*.json
out*.json
readmetadata
tomlvalue
10 changes: 8 additions & 2 deletions FyneApp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ Website = "https://github.com/ErikKalkoken/janice"
Icon = "icon.png"
Name = "Janice"
ID = "io.github.erikkalkoken.janice"
Version = "0.2.1"
Build = 1
Version = "0.2.2"
Build = 2

[LinuxAndBSD]
GenericName = "JSON viewer"
Categories = ["Utility"]
Comment = "View large JSON files"
Keywords = ["json", "viewer"]
27 changes: 18 additions & 9 deletions build_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@
# This script builds an AppImage from a bundeled Fyne app
# for x86_64 architectures with AppStream metadata.

appname="Janice"
packagename="janice"
appid="io.github.erikkalkoken.janice"
categories="Utility"
set -e

# Custom variables
buildname="janice"

# Constants
dest="temp.Appdir"
source="temp.Source"

# get tomlq
wget https://github.com/ErikKalkoken/tomlq/releases/download/v0.1.0/tomlq-0.1.0-linux-amd64.tar.gz -O tomlq.tar.gz
tar xf tomlq.tar.gz
rm tomlq.tar.gz

# Use variables from fyne metadata
appname=$(./tomlq -p Details.Name FyneApp.toml)
appid=$(./tomlq -p Details.ID FyneApp.toml)

# Initialize appdir folder
rm -rf "$source"
mkdir "$source"
Expand All @@ -19,9 +30,6 @@ mkdir "$dest"
# Extract application files into appdir folder
tar xvfJ "$appname".tar.xz -C "$source"

# Add category to desktop file as required by AppImage
sed -i -- "s/;/\nCategories=$categories;/g" "$source/usr/local/share/applications/$appname.desktop"

# Rename desktop file to match AppStream requirements
mv "$source/usr/local/share/applications/$appname.desktop" "$source/usr/local/share/applications/$appid.desktop"

Expand All @@ -32,9 +40,10 @@ cp "$appid.appdata.xml" "$dest/usr/share/metainfo"
# Create appimage
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O linuxdeploy
chmod +x linuxdeploy
./linuxdeploy --appdir "$dest" -v 2 -o appimage -e "$source/usr/local/bin/$packagename" -d "$source/usr/local/share/applications/$appid.desktop" -i "$source/usr/local/share/pixmaps/$appname.png"
./linuxdeploy --appdir "$dest" -v 2 -o appimage -e "$source/usr/local/bin/$buildname" -d "$source/usr/local/share/applications/$appid.desktop" -i "$source/usr/local/share/pixmaps/$appname.png"

# Cleanup
rm -rf "$source"
rm -rf "$dest"
rm linuxdeploy
rm linuxdeploy
rm tomlq

0 comments on commit e2538b5

Please sign in to comment.