Skip to content

Commit 143ea02

Browse files
committed
Feat: update GitHub Actions workflows to use Hatch for versioning and dependency management
1 parent e3578a5 commit 143ea02

7 files changed

Lines changed: 257 additions & 75 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,37 @@ jobs:
1212
os: [windows-latest, macos-latest]
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616

1717
# Nastavíme Python (bez toho by příkaz "python setup.py --version" nemusel fungovat)
1818
- name: Set up Python
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: '3.x'
2222

23-
# Install setuptools
24-
- name: Install setuptools
23+
# Install Hatch
24+
- name: Install Hatch
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install setuptools
27+
pip install hatch
2828
29-
# Získáme verzi z ForrestHub-app/setup.py
30-
- name: Get version from setup.py
29+
# Získáme verzi pomocí Hatch
30+
- name: Get version using Hatch
3131
id: get_version
3232
run: |
3333
cd ForrestHub-app
34-
echo "VERSION=$(python setup.py --version)" >> $GITHUB_ENV
34+
echo "VERSION=$(hatch version)" >> $GITHUB_ENV
3535
3636
- name: Install dependencies
3737
run: |
38-
python -m pip install --upgrade pip
3938
cd ForrestHub-app
40-
pip install -r requirements.txt
41-
pip install pyinstaller
39+
hatch run pip install -r requirements.txt
40+
hatch run pip install pyinstaller
4241
4342
- name: Build executable
4443
run: |
4544
cd ForrestHub-app
46-
pyinstaller pyinstaller.spec
45+
hatch run pyinstaller pyinstaller.spec
4746
4847
- name: Upload artifact
4948
uses: actions/upload-artifact@v4
@@ -65,7 +64,7 @@ jobs:
6564
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6665
with:
6766
# tag_name vychází z tagu, který spustil workflow
68-
tag_name: ${{ github.ref }}
67+
tag_name: ${{ github.ref_name }}
6968

7069
# Využijeme env.VERSION (získanou v jobu build-and-release)
7170
release_name: "Release ${{ env.VERSION }}"
@@ -79,7 +78,7 @@ jobs:
7978
with:
8079
upload_url: ${{ steps.create_release.outputs.upload_url }}
8180
asset_path: ./ForrestHub-Windows/ForrestHub.exe
82-
asset_name: ForrestHub-Windows.exe
81+
asset_name: ForrestHub-${{ env.VERSION }}-Windows.exe
8382
asset_content_type: application/octet-stream
8483

8584
- name: Upload macOS Release Asset
@@ -89,5 +88,5 @@ jobs:
8988
with:
9089
upload_url: ${{ steps.create_release.outputs.upload_url }}
9190
asset_path: ./ForrestHub-macOS/ForrestHub
92-
asset_name: ForrestHub-macOS
91+
asset_name: ForrestHub-${{ env.VERSION }}-macOS
9392
asset_content_type: application/octet-stream

.github/workflows/test-build.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,39 @@ jobs:
1515
permissions: write-all
1616
runs-on: windows-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919

2020
- name: Set up Python
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
2222
with:
2323
python-version: '3.x'
2424

25-
# Install setuptools
26-
- name: Install setuptools
25+
# Install Hatch
26+
- name: Install Hatch
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install setuptools
29+
pip install hatch
3030
31-
# Načtení verze z ForrestHub-app/setup.py a zjištění data (PowerShell)
31+
# Get version and date using Hatch
3232
- name: Get version and date
3333
run: |
3434
cd ForrestHub-app
35-
$version = python setup.py --version
35+
$version = hatch version
3636
echo "VERSION=$version" >> $env:GITHUB_ENV
3737
$dateStr = Get-Date -Format "yyyyMMdd"
3838
echo "DATESTR=$dateStr" >> $env:GITHUB_ENV
3939
shell: pwsh
4040

4141
- name: Install dependencies
4242
run: |
43-
python -m pip install --upgrade pip
4443
cd ForrestHub-app
45-
pip install -r requirements.txt
46-
pip install pyinstaller
44+
hatch run pip install -r requirements.txt
45+
hatch run pip install pyinstaller
4746
4847
- name: Build with PyInstaller
4948
run: |
5049
cd ForrestHub-app
51-
pyinstaller pyinstaller.spec
50+
hatch run pyinstaller pyinstaller.spec
5251
5352
- name: Upload artifact
5453
uses: actions/upload-artifact@v4
@@ -60,40 +59,39 @@ jobs:
6059
permissions: write-all
6160
runs-on: macos-latest
6261
steps:
63-
- uses: actions/checkout@v2
62+
- uses: actions/checkout@v4
6463

6564
- name: Set up Python
66-
uses: actions/setup-python@v2
65+
uses: actions/setup-python@v4
6766
with:
6867
python-version: '3.x'
6968

70-
# Install setuptools
71-
- name: Install setuptools
69+
# Install Hatch
70+
- name: Install Hatch
7271
run: |
7372
python -m pip install --upgrade pip
74-
pip install setuptools
73+
pip install hatch
7574
76-
# Načtení verze z ForrestHub-app/setup.py a zjištění data (bash)
75+
# Get version and date using Hatch
7776
- name: Get version and date
7877
run: |
7978
cd ForrestHub-app
80-
VERSION=$(python setup.py --version)
79+
VERSION=$(hatch version)
8180
echo "VERSION=$VERSION" >> $GITHUB_ENV
8281
DATESTR=$(date +'%Y%m%d')
8382
echo "DATESTR=$DATESTR" >> $GITHUB_ENV
8483
shell: bash
8584

8685
- name: Install dependencies
8786
run: |
88-
python -m pip install --upgrade pip
8987
cd ForrestHub-app
90-
pip install -r requirements.txt
91-
pip install pyinstaller
88+
hatch run pip install -r requirements.txt
89+
hatch run pip install pyinstaller
9290
9391
- name: Build with PyInstaller
9492
run: |
9593
cd ForrestHub-app
96-
pyinstaller pyinstaller.spec
94+
hatch run pyinstaller pyinstaller.spec
9795
9896
- name: Upload artifact
9997
uses: actions/upload-artifact@v4

.github/workflows/web.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- master
66
- main
7+
- feat/add-cron
78
permissions:
89
contents: write
910
jobs:
@@ -18,6 +19,7 @@ jobs:
1819
- uses: actions/setup-python@v5
1920
with:
2021
python-version: 3.x
22+
- run: pip install hatch
2123
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
2224
- uses: actions/cache@v4
2325
with:

ForrestHub-app/MANIFEST.in

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
include VERSION
2+
include requirements.txt
3+
include *.conf.py
4+
include *.spec
5+
include *.cfg
6+
include *.ini
7+
include *.json
8+
include *.pem
9+
include *.key
10+
include *.crt
11+
recursive-include assets *
12+
recursive-include templates *
13+
recursive-include pages *
14+
recursive-include games *
15+
recursive-include docs *
16+
global-exclude *.pyc
17+
global-exclude __pycache__
18+
global-exclude .git*
19+
global-exclude .DS_Store
20+
global-exclude *.log
21+
global-exclude .venv
22+
global-exclude build
23+
global-exclude dist
24+
global-exclude *.egg-info

0 commit comments

Comments
 (0)