-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (79 loc) · 2.58 KB
/
python-app.yml
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
name: Python Application CI
on:
push:
branches: [main]
tags:
- 'v*'
pull_request:
branches: [main]
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install pip if missing
run: |
python -m ensurepip --upgrade
python -m pip install --upgrade pip
- name: Install dependencies
run: |
if (Test-Path -Path "requirements.txt") {
pip install -r requirements.txt
} else {
echo "requirements.txt not found."
}
- name: Run tests
run: python -m unittest discover -s tests
build:
runs-on: windows-latest
needs: test # Ensures build only happens if tests pass
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install pip if missing
run: |
python -m ensurepip --upgrade
python -m pip install --upgrade pip
- name: Install dependencies for Nuitka build
run: |
pip install nuitka tk psutil wmi pywin32 deepdiff customtkinter
- name: Build executable with Nuitka
env:
NUITKA_DOWNLOAD_DEPENDS: "yes" # Automatically allow Dependency Walker download
run: |
python -m nuitka --standalone --onefile --windows-console-mode=disable --output-filename=windowsprofiler.exe --enable-plugin=tk-inter main.py
- name: Upload executable as artifact
uses: actions/upload-artifact@v3
with:
name: windowsprofiler.exe
path: windowsprofiler.exe
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: "Release ${{ github.ref_name }}"
draft: false
prerelease: false
if: startsWith(github.ref, 'refs/tags/')
- name: Upload to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windowsprofiler.exe
asset_name: windowsprofiler.exe
asset_content_type: application/octet-stream
if: startsWith(github.ref, 'refs/tags/')