1+ name : Build Platforms
2+
3+ on :
4+ workflow_dispatch :
5+ workflow_call :
6+
7+ env :
8+ APP_NAME : PingDog
9+ PYTHON_VERSION : 3.14.0
10+
11+ jobs :
12+ build-windows :
13+ runs-on : windows-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+ - uses : actions/setup-python@v5
17+ with :
18+ python-version : ${{ env.PYTHON_VERSION }}
19+
20+ - name : Install dependencies
21+ run : pip install -r requirements.txt pyinstaller
22+ - name : Build
23+ run : pyinstaller ${{ env.APP_NAME }}.win.spec
24+
25+ - name : Package
26+ working-directory : dist
27+ run : |
28+ move ${{ env.APP_NAME }}.exe ${{ env.APP_NAME }}-${{ github.ref_name }}.exe
29+ tar -a -c -f ${{ env.APP_NAME }}-${{ github.ref_name }}-windows.zip ${{ env.APP_NAME }}-${{ github.ref_name }}.exe
30+ - uses : actions/upload-artifact@v4
31+ with :
32+ name : build-windows
33+ path : dist/${{ env.APP_NAME }}-${{ github.ref_name }}-windows.zip
34+
35+ build-linux :
36+ runs-on : ubuntu-latest
37+ strategy :
38+ matrix :
39+ platform :
40+ - linux/amd64
41+ - linux/arm64
42+ steps :
43+ - uses : actions/checkout@v4
44+ - uses : actions/setup-python@v5
45+ with :
46+ python-version : ${{ env.PYTHON_VERSION }}
47+
48+ - name : Install dependencies
49+ run : pip install -r requirements.txt pyinstaller
50+ - name : Build
51+ run : pyinstaller ${{ env.APP_NAME }}.linux.spec
52+
53+ - id : name
54+ run : echo "platform_name=$(echo ${{ matrix.platform }} | sed 's:/:-:g')" >> $GITHUB_OUTPUT
55+ - name : Package
56+ working-directory : dist
57+ run : |
58+ mv ${{ env.APP_NAME }} ${{ env.APP_NAME }}-${{ github.ref_name }}
59+ tar -czf ${{ env.APP_NAME }}-${{ github.ref_name }}-${{ steps.name.outputs.platform_name }}.tar.gz ${{ env.APP_NAME }}-${{ github.ref_name }}
60+ - uses : actions/upload-artifact@v4
61+ with :
62+ name : build-${{ steps.name.outputs.platform_name }}
63+ path : dist/${{ env.APP_NAME }}-${{ github.ref_name }}-${{ steps.name.outputs.platform_name }}.tar.gz
64+
65+ build-macos :
66+ runs-on : macos-latest
67+ steps :
68+ - uses : actions/checkout@v4
69+ - uses : actions/setup-python@v5
70+ with :
71+ python-version : ${{ env.PYTHON_VERSION }}
72+
73+ - name : Install dependencies
74+ run : pip install -r requirements.txt pyinstaller
75+ - name : Build
76+ run : pyinstaller ${{ env.APP_NAME }}.macos.spec
77+
78+ - name : Package
79+ working-directory : dist
80+ run : |
81+ mv ${{ env.APP_NAME }} ${{ env.APP_NAME }}-${{ github.ref_name }}
82+ tar -czf ${{ env.APP_NAME }}-${{ github.ref_name }}-macos.tar.gz ${{ env.APP_NAME }}-${{ github.ref_name }}
83+ - uses : actions/upload-artifact@v4
84+ with :
85+ name : build-macos
86+ path : dist/${{ env.APP_NAME }}-${{ github.ref_name }}-macos.tar.gz
0 commit comments