-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (114 loc) · 4.07 KB
/
build_executables.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build Executables
on:
push:
pull_request:
release:
types:
- created
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v2.4.2
with:
fetch-depth: 0
- name: Save version info
shell: bash
run: |
echo "UPDATE_TOOL_VERSION = '$(git describe --tags --always)'" > update_tool_version.py
- name: Set up Python
uses: actions/setup-python@v3.1.0
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
pip install "pyinstaller==5.13.2"
- name: Build macOS Launcher Script
if: runner.os == 'macOS'
run: |
echo '#!/bin/bash' > wificom-update-tool.command
echo 'SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"' >> wificom-update-tool.command
echo 'cd "$SCRIPT_DIR"' >> wificom-update-tool.command
echo 'python -m pip install --upgrade pip' >> wificom-update-tool.command
echo 'pip install -r requirements.txt' >> wificom-update-tool.command
echo 'python "run.py"' >> wificom-update-tool.command
chmod +x wificom-update-tool.command
mkdir wificom-update-tool
cp wificom-update-tool.command wificom-update-tool/
cp run.py wificom-update-tool/
cp update_tool_version.py wificom-update-tool/
cp requirements.txt wificom-update-tool/
cp README.md wificom-update-tool/
zip -r wificom-update-tool-macos.zip wificom-update-tool/
- name: Build Windows and Linux Executable
if: runner.os != 'macOS'
run: |
pip install pyinstaller
pyinstaller --icon=wificomlogo1.ico --onefile --noupx --hidden-import=queue --name wificom-update-installer run.py
- name: Rename executables
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
mv dist/wificom-update-installer.exe wificom-update-tool.exe
fi
if [ "${{ runner.os }}" == "Linux" ]; then
mv dist/wificom-update-installer wificom-update-tool-linux
fi
- name: Upload as Build Artifact
uses: actions/upload-artifact@v2
with:
name: WiFiCom-Update-Tool-${{ runner.os }}
path: |
wificom-update-tool.exe
wificom-update-tool-linux
wificom-update-tool-macos.zip
- name: Attach to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: |
wificom-update-tool.exe
wificom-update-tool-linux
wificom-update-tool-macos.zip
build-linux-glibc:
runs-on: ubuntu-latest
container:
image: debian:buster
steps:
- name: Checkout
uses: actions/checkout@v2.4.2
- name: Set up Python
run: |
apt-get update
apt-get install -y python3 python3-pip
python3 -m pip install --upgrade pip
- name: Install dependencies
run: |
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
pip install pyinstaller
- name: Build Linux Executable with lower glibc
run: |
pyinstaller --onefile --hidden-import=queue --name wificom-update-installer-glibc228 run.py
mv dist/wificom-update-installer-glibc228 wificom-update-tool-linux-glibc228
- name: Upload as Build Artifact
uses: actions/upload-artifact@v2
with:
name: WiFiCom-Update-Tool-Linux-glibc228
path: wificom-update-tool-linux-glibc228
- name: Attach to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: wificom-update-tool-linux-glibc228