-
Notifications
You must be signed in to change notification settings - Fork 3
139 lines (118 loc) · 3.81 KB
/
build.yml
File metadata and controls
139 lines (118 loc) · 3.81 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
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
132
133
134
135
136
137
138
139
name: Build and Tag
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install pyinstaller pypresence psutil pystray pillow
- name: Build executable
run: |
pyinstaller --onefile --windowed `
--name "HytaleRPC" `
--add-data "src;src" `
--hidden-import pystray `
--hidden-import PIL `
--hidden-import pypresence `
--hidden-import psutil `
hytale_rpc_windows.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: HytaleRPC-Windows
path: dist/HytaleRPC.exe
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install pyinstaller pypresence psutil pystray pillow
- name: Build executable
run: |
python3 -m PyInstaller --onefile \
--name "HytaleRPC" \
--add-data "src:src" \
--hidden-import pystray \
--hidden-import PIL \
--hidden-import pypresence \
--hidden-import psutil \
--hidden-import pystray._xorg \
hytale_rpc.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: HytaleRPC-Linux
path: dist/HytaleRPC
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install pyinstaller pypresence psutil rumps
- name: Build app
run: |
python3 -m PyInstaller --windowed \
--name "Hytale RPC" \
--icon "assets/icon.icns" \
--add-data "src:src" \
--hidden-import rumps \
--hidden-import pypresence \
--hidden-import psutil \
--exclude-module PIL \
--exclude-module numpy \
--exclude-module pandas \
--exclude-module matplotlib \
--exclude-module scipy \
--exclude-module tkinter \
--exclude-module test \
--exclude-module unittest \
--osx-bundle-identifier com.hytale.rpc \
hytale_rpc_macos.py
/usr/libexec/PlistBuddy -c "Add :LSUIElement bool true" "dist/Hytale RPC.app/Contents/Info.plist"
- name: Create DMG
run: |
mkdir -p /tmp/hytale-dmg
cp -r "dist/Hytale RPC.app" /tmp/hytale-dmg/
ln -s /Applications /tmp/hytale-dmg/Applications
hdiutil create -volname "Hytale RPC" \
-srcfolder /tmp/hytale-dmg \
-ov -format UDZO \
"HytaleRPC.dmg"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: HytaleRPC-macOS
path: HytaleRPC.dmg
create-tag:
needs: [build-windows, build-linux, build-macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Create and push tag
run: |
git tag v1.1.2
git push https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/bas3line/hytale-rpc.git v1.1.2
echo "Created tag: v1.1.2"