Skip to content

Commit

Permalink
Minor updates to the script / documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
valicm committed Sep 8, 2022
1 parent 1a2b7b0 commit b8e1a22
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Description

An action for creating AppImage packages from .tar.gz packages.
Generates release AppImage file based on source .tar.gz and stores under latest tag.
GitHub Action for creating AppImage releases from .tar.gz packages.
It generates AppImage file based on source .tar.gz under git tag _latest_.
- only stable version releases
- only build new release if the new version of source .tar.gz had been released

Expand All @@ -23,7 +23,7 @@ See [action.yml](action.yml)
- uses: actions/checkout@v2
- name: Build
id: build
uses: valicm/appimage-bash@v1
uses: valicm/appimage-bash@v1.1
with:
version_url: 'https://dl.pstmn.io/download/latest/linux64'
version_file: 'app/resources/app/package.json'
Expand All @@ -32,7 +32,7 @@ See [action.yml](action.yml)
```

### Action Inputs
- version_url -> URL where the .tar.gz can be downloaded
- version_url -> URL where the source .tar.gz can be downloaded
- version_file -> path to the file which contains version string of .tar.gz package
- version_icon -> name of the image file from original .tar.gz to be used as source icon
- version_bash -> bash code to search for version string inside _version_file_
Expand All @@ -59,14 +59,15 @@ Specification of these properties are same as of action inputs above.

#### Get build.sh
`wget https://raw.githubusercontent.com/valicm/appimage-bash/main/build.sh`
`chmod +x build.sh`
#### Create app.desktop
```desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=PhpStorm
Exec=phpstorm.sh %f
Icon=phpstorm
Icon=Phpstorm
Comment=PhpStorm
Categories=Development;IDE;
Terminal=false
Expand All @@ -76,7 +77,7 @@ StartupWMClass=jetbrains-phpstorm
VersionUrl=https://data.services.jetbrains.com/products/download?code=PS&platform=linux
VersionFile=product-info.json
VersionBash=jq -r .version
VersionIcon=phpstorm.png
VersionIcon=phpstorm.svg
VersionDirectory=opt/phpstorm
```
Expand Down
19 changes: 14 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set -e
# Check AppImage version only -> bash build.sh verify version-only #
###############################################################################

# Flag if we want to use this script to check for version.
# Determine if we're running inside GitHub actions.
GITHUB_RUNNING_ACTION=$GITHUB_ACTIONS

if [ "$GITHUB_RUNNING_ACTION" == false ]; then
Expand Down Expand Up @@ -165,10 +165,19 @@ sed -i '/VersionDirectory/d' $APP_DIRECTORY/"$APP_SHORT_NAME".desktop
ICON_PATH=$(find $APP_DEPLOY -type f -name "$APP_VERSION_ICON")
ICON_EXTENSION="${ICON_PATH#*.}"

cp "$ICON_PATH" $APP_DIRECTORY/"$APP_ICON"."$ICON_EXTENSION"
convert "$ICON_PATH" -resize 512x512 $APP_DIRECTORY/usr/share/icons/hicolor/512x512/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
convert "$ICON_PATH" -resize 256x256 $APP_DIRECTORY/usr/share/icons/hicolor/256x256/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
convert "$ICON_PATH" -resize 128x128 $APP_DIRECTORY/usr/share/icons/hicolor/128x128/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
# Handle svg differently.
if [ "$ICON_EXTENSION" == "svg" ];
then
cp "$ICON_PATH" $APP_DIRECTORY/"$APP_ICON"."$ICON_EXTENSION"
cp "$ICON_PATH" $APP_DIRECTORY/usr/share/icons/hicolor/512x512/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
cp "$ICON_PATH" $APP_DIRECTORY/usr/share/icons/hicolor/256x256/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
cp "$ICON_PATH" $APP_DIRECTORY/usr/share/icons/hicolor/128x128/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
else
cp "$ICON_PATH" $APP_DIRECTORY/"$APP_ICON"."$ICON_EXTENSION"
convert "$ICON_PATH" -resize 512x512 $APP_DIRECTORY/usr/share/icons/hicolor/512x512/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
convert "$ICON_PATH" -resize 256x256 $APP_DIRECTORY/usr/share/icons/hicolor/256x256/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
convert "$ICON_PATH" -resize 128x128 $APP_DIRECTORY/usr/share/icons/hicolor/128x128/apps/"$APP_SHORT_NAME"."$ICON_EXTENSION"
fi

echo "==> Build $APP_SHORT_NAME AppImage"
# Fetch AppImageTool.
Expand Down

0 comments on commit b8e1a22

Please sign in to comment.