Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tests

on:
push:
branches:
- main
- "feature/**"

pull_request:
branches:
- main

workflow_dispatch:

permissions:
contents: read

concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Python ${{ matrix.python-version }}

runs-on: windows-latest

timeout-minutes: 15

strategy:
fail-fast: false

matrix:
python-version:
- "3.12"
- "3.13"

steps:
- name: Check out repository
uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: pip
cache-dependency-path: pyproject.toml

- name: Show Python version
run: python --version

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install project
run: python -m pip install -e ".[dev]"

- name: Compile-check source
run: >
python -m compileall
main.py
documents_organizer

- name: Run tests
run: python -m pytest -v
66 changes: 66 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Windows Build

on:
pull_request:
branches:
- main

push:
tags:
- "v*"

workflow_dispatch:

permissions:
contents: read

concurrency:
group: windows-build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build Windows x64

runs-on: windows-latest

timeout-minutes: 30

steps:
- name: Check out repository
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.13.15"
architecture: x64
cache: pip
cache-dependency-path: pyproject.toml

- name: Show Python version
run: python --version

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install project
run: python -m pip install -e ".[dev]"

- name: Build Windows release artifact
shell: pwsh
run: .\scripts\build-windows.ps1

- name: List release artifacts
shell: pwsh
run: Get-ChildItem .\artifacts\

- name: Upload Windows release artifacts
uses: actions/upload-artifact@v7
with:
name: documents-organizer-windows-x64
path: |
artifacts/*.zip
artifacts/*.sha256.txt
if-no-files-found: error
retention-days: 14
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
#*.spec

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -158,4 +158,12 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
.pytest_tmp/

# PyInstaller
/build/
/dist/

# Release artifacts
/artifacts/
85 changes: 85 additions & 0 deletions DocumentsOrganizer.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# -*- mode: python ; coding: utf-8 -*-

from pathlib import Path


project_root = Path(SPECPATH)

app_name = "DocumentsOrganizer"

entry_point = project_root / "main.py"

icon_path = (
project_root
/ "images"
/ "folder-256.ico"
)

images_path = (
project_root
/ "images"
)

version_info_path = (
project_root
/ "packaging"
/ "windows"
/ "version_info.txt"
)

a = Analysis(
[str(entry_point)],
pathex=[
str(project_root),
],
binaries=[],
datas=[
(
str(images_path),
"images",
),
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)

pyz = PYZ(
a.pure
)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name=app_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
version=str(version_info_path),
icon=[
str(icon_path),
],
)

coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name=app_name,
)
Loading