Skip to content

Commit ea57173

Browse files
committed
feat(config): Make changes to config to use pydantic settings
1 parent 31ae83f commit ea57173

File tree

74 files changed

+2293
-901
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2293
-901
lines changed

.env.example

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/release-and-publish.yml

Lines changed: 96 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,127 @@
1-
name: Semantic Release and PyPI Publish
1+
name: Release and PyPI Publish
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9+
build-macos-executables:
10+
name: Build macOS app
11+
runs-on: macos-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Set up Pythonx`
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.10'
21+
- name: Install dependencies
22+
run: |
23+
pip install poetry
24+
poetry install
25+
brew install nvm
26+
poetry run install-dashboard
27+
brew install [email protected]
28+
- name: Build executables
29+
run: |
30+
poetry run python -m openadapt.build
31+
cd dist
32+
zip -r ../OpenAdapt.app.zip OpenAdapt.app
33+
cd ..
34+
- name: Upload executables
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: OpenAdapt.app
38+
path: OpenAdapt.app.zip
39+
40+
build-windows-executables:
41+
name: Build Windows app
42+
runs-on: windows-latest
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0
48+
- name: Set up Python
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: '3.10'
52+
- name: Set up Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 21
56+
- name: Install dependencies
57+
run: |
58+
pip install poetry
59+
poetry install
60+
cd openadapt/app/dashboard
61+
npm install
62+
cd ../../../
63+
- name: Build executables
64+
run: |
65+
poetry run python -m openadapt.build
66+
cd dist
67+
7z a -tzip ../OpenAdapt.zip OpenAdapt
68+
cd ..
69+
- name: Upload executables
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: OpenAdapt
73+
path: OpenAdapt.zip
74+
975
release:
1076
runs-on: ubuntu-latest
77+
needs: [build-macos-executables, build-windows-executables]
1178
concurrency: release
79+
permissions:
80+
id-token: write
81+
contents: write
1282
steps:
1383
- name: Checkout repository
14-
uses: actions/checkout@v2
84+
uses: actions/checkout@v4
1585
with:
1686
fetch-depth: 0
17-
token: ${{ secrets.ADMIN_TOKEN }} # Use the new token for authentication
87+
- name: Download macOS executable
88+
uses: actions/download-artifact@v4
89+
with:
90+
name: OpenAdapt.app
91+
path: dist/
92+
- name: Download Windows executable
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: OpenAdapt
96+
path: dist/
1897
- name: Python Semantic Release
1998
id: semantic_release
2099
uses: relekang/python-semantic-release@master
21100
with:
22-
github_token: ${{ secrets.ADMIN_TOKEN }} # Use the new token for authentication
101+
github_token: ${{ secrets.GITHUB_TOKEN }}
23102
git_committer_name: "OpenAdapt Bot"
24103
git_committer_email: "[email protected]"
25-
104+
- name: Install the latest version of the project
105+
run: |
106+
git pull
107+
pip install poetry
108+
poetry install
109+
- name: Upload release assets
110+
env:
111+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
run: |
113+
./build_scripts/upload_release_artifacts.sh
26114
publish:
115+
name: Publish to PyPI
27116
needs: release
28117
runs-on: ubuntu-latest
29118
steps:
30119
- name: Checkout repository
31-
uses: actions/checkout@v3
120+
uses: actions/checkout@v4
32121
with:
33122
ref: main
34123
- name: Set up Python
35-
uses: actions/setup-python@v3
124+
uses: actions/setup-python@v4
36125
with:
37126
python-version: '3.10'
38127
- name: Publish to PyPI

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Envirionment
22
.env
3+
config.local.json
34

45
# Python
56
__pycache__
@@ -33,3 +34,6 @@ src
3334

3435
*.pyc
3536
*.pt
37+
38+
dist/
39+
build/

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ cd OpenAdapt
9595
pip3 install poetry
9696
poetry install
9797
poetry shell
98-
alembic upgrade head
9998
poetry run install-dashbaord
10099
100+
cd openadapt
101+
alembic upgrade head
102+
cd ..
103+
101104
pytest
102105
```
103106

alembic/versions/104d4a614d95_add_performancestat.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

alembic/versions/607d1380b5ae_add_memorystat.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

alembic/versions/b206c80f7640_add_recording_inputevent_screenshot_.py

Lines changed: 0 additions & 84 deletions
This file was deleted.

alembic/versions/ec337f277666_datetime_timestamp.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

build_scripts/get_version.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""Get the version of the package."""
2+
3+
import importlib.metadata
4+
5+
6+
def get_version() -> str:
7+
"""Get the version of the package."""
8+
return importlib.metadata.version("openadapt")
9+
10+
11+
if __name__ == "__main__":
12+
print(get_version())

build_scripts/macos.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
BASH_LOCATION=$(dirname $0)
4+
5+
osascript -e 'tell app "Terminal"
6+
do script "cd '$BASH_LOCATION' && ./OpenAdapt.app; exit;"
7+
end tell'

0 commit comments

Comments
 (0)