11name : Build, test & upload new version
22
33on :
4+ workflow_dispatch :
45 push :
56 branches : [ "main" ]
67 pull_request :
910permissions :
1011 contents : read
1112
13+ env :
14+ PY_VERSION : 3.12
15+ PYTHONIOENCODING : utf-8:replace
16+
1217jobs :
13- build :
18+ test_and_build :
19+ name : Test and Build for distribution
1420 strategy :
21+ fail-fast : false
1522 matrix :
16- os : [ ubuntu-latest, windows-latest ]
23+ os : [ windows-latest, ubuntu-latest ]
24+ include :
25+ - os : ubuntu-latest
26+ uv_cache : ~/.cache/uv
27+ uv_install : curl -LsSf https://astral.sh/uv/install.sh | sh
28+ - os : windows-latest
29+ uv_cache : C:\Users\runneradmin\AppData\Local\uv\cache
30+ uv_install : |
31+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
32+ export PATH=$PATH:"/C/Users/runneradmin/.local/bin"
33+
1734
1835 runs-on : ${{ matrix.os }}
1936
2037 steps :
2138 - uses : actions/checkout@v3
22- - name : Set up Python 3.11
39+ - name : Cache Python and UV
40+ id : cache-python
41+ uses : actions/cache@v4
42+ env :
43+ cache-name : cache-python-uv
44+ with :
45+ path : |
46+ .venv
47+ ${{ matrix.uv_cache }}
48+ key : ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('uv.lock') }}
49+ restore-keys : |
50+ ${{ runner.os }}-test-${{ env.cache-name }}-
51+ ${{ runner.os }}-test-
52+ ${{ runner.os }}-
53+ - name : Set up Python ${{ env.PY_VERSION }}
2354 uses : actions/setup-python@v4
2455 with :
25- python-version : " 3.11 "
26- - name : Setup environment
56+ python-version : ${{ env.PY_VERSION }}
57+ - name : Install requirements
2758 shell : bash
2859 run : |
60+ ${{ matrix.uv_install }}
61+
2962 if [ "$RUNNER_OS" == "Linux" ]; then
3063 sudo apt-get install libcairo-dev libgirepository1.0-dev python3-gi gobject-introspection gir1.2-gtk-3.0 gir1.2-appindicator3-0.1
3164 fi
32- python -m pip install packaging pipenv psutil
33- python setup.py setup
65+
66+ pip install packaging psutil
67+ - name : Run setup
68+ run : python setup.py setup
69+ - name : Run tests
70+ run : python setup.py test
3471 - name : Build
3572 run : python setup.py build
3673 - name : Upload files
37- uses : actions/upload-artifact@v3
74+ uses : actions/upload-artifact@v4
3875 with :
3976 name : ${{ matrix.os }} dist files
40- path : dist/discord.fm-*
41- test :
42- strategy :
43- matrix :
44- os : [ windows-latest, ubuntu-latest ]
45-
46- runs-on : ${{ matrix.os }}
47-
48- # TODO: Add cache support
49- steps :
50- - uses : actions/checkout@v3
51- - name : Set up Python 3.11
52- uses : actions/setup-python@v4
53- with :
54- python-version : " 3.11"
55- - name : Setup environment
56- shell : bash
57- run : |
58- python -m pip install packaging pipenv psutil
59- python setup.py setup
60- - name : Run tests
61- run : python setup.py test
77+ path : dist/discord.fm-*.*
0 commit comments