-
Notifications
You must be signed in to change notification settings - Fork 71
72 lines (70 loc) · 2.89 KB
/
push.yml
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
name: build test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
Build:
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os:
- ubuntu-22.04
- macos-11
- windows-2022
python-version:
- '3.8'
steps:
- name: 'Install Packages'
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
sudo apt-get install -yq x11-utils libxkbcommon-x11-0 libfuse2
elif [ "${{ runner.os }}" == "macOS" ]; then
brew install create-dmg
elif [ "${{ runner.os }}" == "Windows" ]; then
echo "Noting to install on windows"
else
echo "${{ runner.os }} not supported"
exit 1
fi
shell: bash
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v3
with:
python-version: '${{ matrix.python-version }}'
- uses: actions/checkout@v3
with:
submodules: recursive
- run: pip3 install --upgrade pip
- run: pip3 install -r requirements.txt
- run: pip3 freeze
- run: python3 pack.py || python pack.py
- name: 'Before deploy'
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
export GLIBC_VER=$(ldd --version | grep ldd | awk '{ print $NF }')
mv "dist/kflash_gui.tar.xz" "dist/kflash_gui_${{ github.ref_name }}_linux_glibc${GLIBC_VER}.tar.xz"
mkdir -p "dist/AppDir/usr/bin"
cp -rf "dist/kflash_gui" "dist/AppDir/usr/bin/kflash_gui"
mkdir -p "dist/AppDir/usr/share/icons/hicolor/128x128/apps"
cp -rf "kflash_gui_data/assets/logo.png" "dist/AppDir/usr/share/icons/hicolor/128x128/apps/kflash_gui.png"
mkdir -p "dist/AppDir/usr/share/applications"
cp -rf "kflash_gui_data/application/kflash_gui.desktop" "dist/AppDir/usr/share/applications/kflash_gui.desktop"
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage
pushd "dist" && ../linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir "AppDir" --output appimage && popd
LD_LIBRARY_PATH='' find dist/AppDir -type f -exec ldd {} 2>&1 \; | grep '=>' | grep -v AppDir
ls -l "dist"
mv dist/*.AppImage "dist/kflash_gui_${{ github.ref_name }}_linux_glibc${GLIBC_VER}.AppImage"
elif [ "${{ runner.os }}" == "macOS" ]; then
mv "dist/kflash_gui.dmg" "dist/kflash_gui_${{ github.ref_name }}_macOS.dmg"
elif [ "${{ runner.os }}" == "Windows" ]; then
mv "dist/kflash_gui.7z" "dist/kflash_gui_${{ github.ref_name }}_windows.7z"
else
echo "${{ runner.os }} not supported"
exit 1
fi
find dist
shell: bash