Skip to content

updated workflow

updated workflow #2

Workflow file for this run

name: Python Application CI
on:
push:
branches: [main]
tags: # Add this to trigger the workflow on tag creation
- 'v*' # Matches tags like "v1.0", "v2.1", etc.
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
run: |
python -m nuitka --standalone --onefile --disable-console --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/')