mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-19 01:43:42 +01:00
Added appimage
This commit is contained in:
parent
f66a46ecce
commit
707ccd376f
55
.github/workflows/release.yml
vendored
55
.github/workflows/release.yml
vendored
@ -52,3 +52,58 @@ jobs:
|
||||
uses: JRubics/poetry-publish@v1.15
|
||||
with:
|
||||
pypi_token: ${{ secrets.PYPI_API_KEY }}
|
||||
|
||||
appimage:
|
||||
needs: [ release ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt update -y && sudo apt install -y software-properties-common curl git fuse
|
||||
|
||||
- name: Add deadsnakes PPA and install Python 3.9
|
||||
run: |
|
||||
sudo add-apt-repository -y ppa:deadsnakes/ppa
|
||||
sudo apt install -y python3.9 python3.9-distutils
|
||||
|
||||
- name: Install Poetry
|
||||
run: curl -sSL https://install.python-poetry.org | python3.9 -
|
||||
|
||||
- name: Add Poetry to PATH
|
||||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Build AppImage
|
||||
run: bash build_appimage.sh
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: LNbits.AppImage
|
||||
path: LNbits*.AppImage
|
||||
|
||||
release-appimage:
|
||||
needs: [ appimage ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download AppImage
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: LNbits.AppImage
|
||||
path: .
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./LNbits*.AppImage
|
||||
asset_name: LNbits.AppImage
|
||||
asset_content_type: application/octet-stream
|
70
build_appimage.sh
Normal file
70
build_appimage.sh
Normal file
@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Define variables
|
||||
APP_NAME="LNbits"
|
||||
APP_VERSION="1.0.0"
|
||||
APP_DIR="${APP_NAME}.AppDir"
|
||||
APPIMAGE_TOOL="appimagetool-x86_64.AppImage"
|
||||
|
||||
# Install dependencies
|
||||
sudo apt update -y
|
||||
sudo apt install -y software-properties-common curl git fuse
|
||||
|
||||
# Add the deadsnakes PPA repository and install Python 3.9
|
||||
sudo add-apt-repository -y ppa:deadsnakes/ppa
|
||||
sudo apt install -y python3.9 python3.9-distutils
|
||||
|
||||
# Install Poetry
|
||||
curl -sSL https://install.python-poetry.org | python3.9 -
|
||||
|
||||
# Add Poetry to PATH
|
||||
export PATH="/home/$USER/.local/bin:$PATH"
|
||||
|
||||
# Clone the LNbits repository
|
||||
if [ ! -d lnbits ]; then
|
||||
git clone https://github.com/lnbits/lnbits.git
|
||||
fi
|
||||
|
||||
cd lnbits
|
||||
|
||||
# Check out the main branch and install dependencies
|
||||
git checkout main
|
||||
poetry env use python3.9
|
||||
poetry install --only main
|
||||
|
||||
# Create the AppDir structure
|
||||
mkdir -p ${APP_DIR}/usr/bin
|
||||
mkdir -p ${APP_DIR}/usr/share/applications
|
||||
mkdir -p ${APP_DIR}/usr/share/icons/hicolor/256x256/apps
|
||||
|
||||
# Copy the LNbits files to the AppDir
|
||||
cp -r * ${APP_DIR}/usr/bin/
|
||||
|
||||
# Create a desktop entry
|
||||
cat > ${APP_DIR}/usr/share/applications/${APP_NAME}.desktop <<EOF
|
||||
[Desktop Entry]
|
||||
Name=${APP_NAME}
|
||||
Exec=${APP_NAME}
|
||||
Icon=${APP_NAME}
|
||||
Type=Application
|
||||
Categories=Utility;
|
||||
EOF
|
||||
|
||||
# Create an icon (replace with your actual icon)
|
||||
cp path/to/icon.png ${APP_DIR}/usr/share/icons/hicolor/256x256/apps/${APP_NAME}.png
|
||||
|
||||
# Download the AppImage tool
|
||||
if [ ! -f ${APPIMAGE_TOOL} ]; then
|
||||
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/${APPIMAGE_TOOL}
|
||||
chmod +x ${APPIMAGE_TOOL}
|
||||
fi
|
||||
|
||||
# Build the AppImage
|
||||
./${APPIMAGE_TOOL} ${APP_DIR}
|
||||
|
||||
# Move the AppImage to the output directory
|
||||
mv ${APP_NAME}*.AppImage ../
|
||||
|
||||
echo "AppImage created successfully!"
|
Loading…
Reference in New Issue
Block a user