Skip to content

Commit bde6d72

Browse files
authored
Merge pull request #24 from IPdotSetAF/2-cicd-and-executable
2 cicd and executable
2 parents d22cb89 + 9cd216b commit bde6d72

8 files changed

Lines changed: 246 additions & 11 deletions

File tree

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
env:
13+
APP_NAME: PingDog
14+
15+
jobs:
16+
build:
17+
uses: ./.github/workflows/build-platforms.yml
18+
19+
release:
20+
runs-on: ubuntu-latest
21+
if: github.ref_type == 'tag'
22+
needs: [build]
23+
steps:
24+
- uses: actions/download-artifact@v4
25+
with:
26+
pattern: build-*
27+
path: ./
28+
merge-multiple: true
29+
- name: Release
30+
uses: softprops/action-gh-release@v2
31+
with:
32+
prerelease: true
33+
generate_release_notes: true
34+
files: |
35+
${{ env.APP_NAME }}-${{ github.ref_name }}-windows.zip
36+
${{ env.APP_NAME }}-${{ github.ref_name }}-linux-amd64.tar.gz
37+
${{ env.APP_NAME }}-${{ github.ref_name }}-linux-arm64.tar.gz
38+
${{ env.APP_NAME }}-${{ github.ref_name }}-macos.tar.gz

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ MANIFEST
3030
# Usually these files are written by a python script from a template
3131
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3232
*.manifest
33-
*.spec
3433

3534
# Installer logs
3635
pip-log.txt

PingDog.linux.spec

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
a = Analysis(
5+
['PingDog.py'],
6+
pathex=[],
7+
binaries=[],
8+
datas=[('Dialogs.tcss', '.')],
9+
hiddenimports=[],
10+
hookspath=[],
11+
hooksconfig={},
12+
runtime_hooks=[],
13+
excludes=[],
14+
noarchive=False,
15+
optimize=0,
16+
)
17+
pyz = PYZ(a.pure)
18+
19+
exe = EXE(
20+
pyz,
21+
a.scripts,
22+
a.binaries,
23+
a.datas,
24+
[],
25+
name='PingDog',
26+
debug=False,
27+
bootloader_ignore_signals=False,
28+
strip=False,
29+
upx=True,
30+
upx_exclude=[],
31+
runtime_tmpdir=None,
32+
console=True,
33+
disable_windowed_traceback=False,
34+
argv_emulation=False,
35+
target_arch=None,
36+
codesign_identity=None,
37+
entitlements_file=None,
38+
)

PingDog.macos.spec

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
a = Analysis(
5+
['PingDog.py'],
6+
pathex=[],
7+
binaries=[],
8+
datas=[('Dialogs.tcss', '.')],
9+
hiddenimports=[],
10+
hookspath=[],
11+
hooksconfig={},
12+
runtime_hooks=[],
13+
excludes=[],
14+
noarchive=False,
15+
optimize=0,
16+
)
17+
pyz = PYZ(a.pure)
18+
19+
exe = EXE(
20+
pyz,
21+
a.scripts,
22+
a.binaries,
23+
a.datas,
24+
[],
25+
name='PingDog',
26+
debug=False,
27+
bootloader_ignore_signals=False,
28+
strip=False,
29+
upx=True,
30+
upx_exclude=[],
31+
runtime_tmpdir=None,
32+
console=True,
33+
disable_windowed_traceback=False,
34+
argv_emulation=False,
35+
target_arch=None,
36+
codesign_identity=None,
37+
entitlements_file=None,
38+
)

PingDog.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,14 @@ def update_table(self):
250250
table.update_cell(url, "last_checked", last_checked_text, update_width=True)
251251

252252
def splash_screen() -> str:
253-
with open('art.txt', 'r', encoding='utf-8') as f:
254-
ascii_art = f.read()
255-
return ascii_art
253+
return r'''
254+
_/\/\/\/\/\____/\/\________________________________/\/\/\/\/\___________________________
255+
_/\/\____/\/\__________/\/\/\/\______/\/\/\/\______/\/\____/\/\____/\/\/\______/\/\/\/\_
256+
_/\/\/\/\/\____/\/\____/\/\__/\/\__/\/\__/\/\______/\/\____/\/\__/\/\__/\/\__/\/\__/\/\_
257+
_/\/\__________/\/\____/\/\__/\/\____/\/\/\/\______/\/\____/\/\__/\/\__/\/\____/\/\/\/\_
258+
_/\/\__________/\/\/\__/\/\__/\/\________/\/\______/\/\/\/\/\______/\/\/\__________/\/\_
259+
___________________________________/\/\/\/\__________________________________/\/\/\/\___
260+
'''
256261

257262
def clear_splash_screen():
258263
lines = splash_screen().count('\n') or 1

PingDog.win.spec

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
a = Analysis(
5+
['PingDog.py'],
6+
pathex=[],
7+
binaries=[],
8+
datas=[('Dialogs.tcss', '.')],
9+
hiddenimports=[],
10+
hookspath=[],
11+
hooksconfig={},
12+
runtime_hooks=[],
13+
excludes=[],
14+
noarchive=False,
15+
optimize=0,
16+
)
17+
pyz = PYZ(a.pure)
18+
19+
exe = EXE(
20+
pyz,
21+
a.scripts,
22+
a.binaries,
23+
a.datas,
24+
[],
25+
name='PingDog',
26+
debug=False,
27+
bootloader_ignore_signals=False,
28+
strip=False,
29+
upx=True,
30+
upx_exclude=[],
31+
runtime_tmpdir=None,
32+
console=True,
33+
disable_windowed_traceback=False,
34+
argv_emulation=False,
35+
target_arch=None,
36+
codesign_identity=None,
37+
entitlements_file=None,
38+
)

art.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)