-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (79 loc) · 2.94 KB
/
Copy pathDistribute_Linux_AppImage.yml
File metadata and controls
101 lines (79 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Station Response Manager Build Linux AppImage
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
Build-Linux-AppImage:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y patchelf libfuse2
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements_win_build.txt ]; then pip install -r requirements_win_build.txt; fi
- name: Get version from tag
run: echo "VERSION=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
- name: Replace version in setup.py
run: sed -i "s/__VERSION__/${VERSION}/g" setup.py
- name: Build with cx_Freeze
run: python setup.py build
- name: Build AppImage
run: |
set -e
APP_NAME="Station_Response_Manager"
APPDIR="AppDir"
DIST_DIR="build/Station_Response_Manager"
rm -rf "$APPDIR"
mkdir -p "$APPDIR/usr/bin"
mkdir -p "$APPDIR/usr/lib/$APP_NAME"
mkdir -p "$APPDIR/usr/share/applications"
mkdir -p "$APPDIR/usr/share/icons/hicolor/256x256/apps"
cp -a "$DIST_DIR"/. "$APPDIR/usr/lib/$APP_NAME/"
cat > "$APPDIR/usr/bin/srm" << 'EOF'
#!/bin/sh
HERE="$(dirname "$(readlink -f "$0")")"
export LD_LIBRARY_PATH="$HERE/../lib/Station_Response_Manager/lib:${LD_LIBRARY_PATH:-}"
exec "$HERE/../lib/Station_Response_Manager/SRM" "$@"
EOF
chmod +x "$APPDIR/usr/bin/srm"
cat > "$APPDIR/AppRun" << 'EOF'
#!/bin/sh
HERE="$(dirname "$(readlink -f "$0")")"
exec "$HERE/usr/bin/srm" "$@"
EOF
chmod +x "$APPDIR/AppRun"
cat > "$APPDIR/SRM.desktop" << 'EOF'
[Desktop Entry]
Type=Application
Name=Station Response Manager
Exec=SRM
Icon=SRM
Categories=Science;
Terminal=false
StartupWMClass=SRM
EOF
cp "$APPDIR/SRM.desktop" "$APPDIR/usr/share/applications/SRM.desktop"
cp resources/icon.png "$APPDIR/SRM.png"
cp resources/icon.png "$APPDIR/usr/share/icons/hicolor/256x256/apps/SRM.png"
wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
APPIMAGE_EXTRACT_AND_RUN=1 ARCH=x86_64 ./appimagetool-x86_64.AppImage "$APPDIR" "Station_Response_Manager_${VERSION}_Linux.AppImage"
- name: Upload Release Asset
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view "$VERSION" >/dev/null 2>&1 || gh release create "$VERSION" --title "$VERSION" --notes ""
gh release upload "$VERSION" "Station_Response_Manager_${VERSION}_Linux.AppImage" --clobber