-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 2.27 KB
/
build_and_scan.yml
File metadata and controls
83 lines (72 loc) · 2.27 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
name: Build and Scan
on:
push:
branches:
- master
paths:
- 'app.py'
- 'core/**/*.py'
- 'ui/**/*.py'
- 'requirements.txt'
- 'python.ico'
- 'python.png'
- '.github/workflows/build_and_scan.yml'
pull_request:
branches:
- master
paths:
- 'app.py'
- 'core/**/*.py'
- 'ui/**/*.py'
- 'requirements.txt'
- 'python.ico'
- 'python.png'
- '.github/workflows/build_and_scan.yml'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build EXE
run: |
python -m PyInstaller --clean --noupx --onefile --windowed --icon=python.ico --add-data "python.ico;." --add-data "python.png;." --name="PythonProjectMngr" app.py
env:
PYTHONIOENCODING: utf-8
- name: Restore code signing certificate
shell: powershell
run: |
$pfxBase64 = "${{ secrets.PFX_BASE64 }}"
$pfxBytes = [System.Convert]::FromBase64String($pfxBase64)
[IO.File]::WriteAllBytes("kingtriton.pfx", $pfxBytes)
- name: Install Windows SDK Signing Tools
shell: powershell
run: |
choco install windows-sdk-10-version-2004-all -y
- name: Sign EXE
shell: powershell
run: |
$signtool = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe"
if (!(Test-Path $signtool)) {
$signtool = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x64\signtool.exe"
}
& "$signtool" sign /f kingtriton.pfx /p "${{ secrets.PFX_PASSWORD }}" /tr http://timestamp.digicert.com /td sha256 /fd sha256 "dist\PythonProjectMngr.exe"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: PythonProjectMngr
path: dist/PythonProjectMngr.exe
- name: VirusTotal GitHub Action
uses: crazy-max/ghaction-virustotal@v4.0.0
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
files: dist/PythonProjectMngr.exe