-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (45 loc) · 1.38 KB
/
workflow.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: windows-latest
outputs:
files: ${{ steps.file_changes.outputs.files }}
build: ${{ steps.build.outputs.ifbuild }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 20
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Check for file changes
id: file_changes
run: |
git diff --name-only ${{ github.event.before }} ${{ github.event.after }} > changed_files.txt
echo "files=$(cat changed_files.txt)" >> $env:GITHUB_OUTPUT
- name: Build project
id: build
run: |
if (Get-Content changed_files.txt | Select-String -Pattern "version.rc|src/init.py") {
echo "ifbuild=true" >> $env:GITHUB_OUTPUT
pip install -r requirements.txt pyinstaller
pyinstaller --noconfirm build.spec
} else {
echo "No changes in version.rc or src/init.py. Skipping build."
echo "ifbuild=false" >> $env:GITHUB_OUTPUT
}
- name: Upload artifact
if: steps.build.outputs.ifbuild == 'true'
uses: actions/upload-artifact@v4
with:
name: Polsu Overlay
path: dist/Polsu Overlay.exe