11name : Bundle with Pyinstaller
2- on : push
2+ on :
3+ push :
4+ branches : ' *'
5+ tags : ' v*'
36
47jobs :
58 frontend :
69 runs-on : ubuntu-latest
710 outputs :
811 tag : ${{ steps.set_tag.outputs.tag }}
912 steps :
10- - uses : actions/checkout@v3
13+ - uses : actions/checkout@v4
1114 with :
1215 submodules : recursive
1316
1922 echo "tag=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
2023 fi
2124
22- - uses : actions/setup-node@v3
25+ - uses : actions/setup-node@v4
2326 with :
24- node-version : 16
27+ node-version : 18
2528
2629 - name : Build Frontend
2730 working-directory : frontend
3033 npm run build
3134
3235 - name : Upload Artifact
33- uses : actions/upload-artifact@v3
36+ uses : actions/upload-artifact@v4
3437 with :
3538 name : frontend
3639 path : frontend/dist
@@ -42,47 +45,86 @@ jobs:
4245 os : [macos, ubuntu, windows]
4346 runs-on : ${{ matrix.os }}-latest
4447 steps :
45- - uses : actions/checkout@v3
48+ - uses : actions/checkout@v4
4649 with :
4750 submodules : recursive
4851
4952 - name : Download Frontend
50- uses : actions/download-artifact@v3
53+ uses : actions/download-artifact@v4
5154 with :
5255 name : frontend
5356 path : frontend/dist
5457
55- - name : Install Dependencies
56- run : pip3 install -r requirements.txt
58+ - uses : actions/setup-python@v5
59+ with :
60+ python-version : ' 3.12'
5761
58- - name : Bundle blivechat (Unix )
59- if : matrix.os != 'windows '
62+ - name : Install Dependencies (Host Native )
63+ if : matrix.os != 'macos '
6064 run : |
65+ python3 -m venv venv
66+ ${{ matrix.os == 'windows' && 'venv\\Scripts\\activate' || 'source venv/bin/activate' }}
67+ pip3 install -r requirements.txt
6168 pip3 install pyinstaller
69+
70+ - name : Install Dependencies (macOS Universal)
71+ if : matrix.os == 'macos'
72+ run : |
73+ python3 -m venv venv
74+ source venv/bin/activate
75+ pip3 download --no-cache-dir --only-binary=:all: \
76+ --platform=macosx_10_13_universal2 \
77+ -d downloads \
78+ -r requirements.txt \
79+ pyinstaller
80+ pip3 install --upgrade --no-cache-dir --no-index --only-binary=:all: \
81+ --find-links downloads \
82+ -r requirements.txt \
83+ pyinstaller
84+
85+ - name : Bundle blivechat (Linux)
86+ if : matrix.os == 'ubuntu'
87+ run : |
88+ source venv/bin/activate
89+ pyinstaller --noconfirm \
90+ --add-data="data:data" \
91+ --add-data="log:log" \
92+ --add-data="frontend/dist:frontend/dist" \
93+ --name blivechat \
94+ --contents-directory . \
95+ main.py
96+
97+ - name : Bundle blivechat (macOS Universal)
98+ if : matrix.os == 'macos'
99+ run : |
100+ source venv/bin/activate
62101 pyinstaller --noconfirm \
63102 --add-data="data:data" \
64103 --add-data="log:log" \
65104 --add-data="frontend/dist:frontend/dist" \
66105 --name blivechat \
106+ --contents-directory . \
107+ --target-arch universal2 \
67108 main.py
68109
69110 - name : Bundle blivechat (Windows)
70111 if : matrix.os == 'windows'
71112 run : |
72- pip3 install pyinstaller
113+ venv\\Scripts\\activate
73114 pyinstaller --noconfirm `
74115 --add-data="data;data" `
75116 --add-data="log;log" `
76117 --add-data="frontend\dist;frontend\dist" `
77118 --name blivechat `
119+ --contents-directory . `
78120 main.py
79121
80122 - name : Package Bundle
81123 working-directory : dist
82124 run : 7z a -tzip blivechat-${{ needs.frontend.outputs.tag }}-${{ matrix.os }}-x64.zip blivechat
83125
84126 - name : Upload Artifact
85- uses : actions/upload-artifact@v3
127+ uses : actions/upload-artifact@v4
86128 with :
87129 name : blivechat-${{ matrix.os }}-x64
88130 path : dist/blivechat-*.zip
95137 contents : write
96138 steps :
97139 - name : Download Artifact
98- uses : actions/download-artifact@v3
140+ uses : actions/download-artifact@v4
99141
100142 - name : Create Release
101- uses : softprops/action-gh-release@v1
143+ uses : softprops/action-gh-release@v2
102144 with :
103145 files : ./**/blivechat-*.zip
0 commit comments