@@ -14,40 +14,52 @@ jobs:
14
14
run : |
15
15
sudo apt update
16
16
sudo apt install -y git
17
+
18
+ - name : Set up Python
19
+ uses : actions/setup-python@v5
20
+ with :
21
+ python-version : ' 3.10'
22
+
17
23
- name : Install uv
18
24
uses : astral-sh/setup-uv@v3
25
+
19
26
- name : Install Node Env
20
27
uses : actions/setup-node@v4
21
28
with :
22
29
node-version : 20
30
+
23
31
- name : Checkout
24
32
25
33
with :
26
34
fetch-depth : 0
27
35
persist-credentials : false
28
- - name : Build app
36
+
37
+ - name : Install dependencies
29
38
run : |
39
+ uv pip install build hatchling hatch-vcs
30
40
uv sync --frozen
31
- uv build
41
+
42
+ - name : Build package
43
+ run : python -m build
32
44
id : build_cache
33
- if : success()
34
- - name : Cache build
35
- uses : actions/cache@v2
45
+
46
+ - name : Cache build artifacts
47
+ uses : actions/cache@v3
36
48
with :
37
- path : ./dist
38
- key : ${{ runner.os }}-build-${{ hashFiles('dist/**') }}
39
- if : steps.build_cache.outputs.id != ''
49
+ path : |
50
+ ./dist
51
+ ./build
52
+ key : ${{ runner.os }}-build-${{ github.sha }}
40
53
41
54
release :
42
55
name : Release
43
56
runs-on : ubuntu-latest
44
57
needs : build
45
58
environment : development
46
- if : |
47
- github.event_name == 'push' && github.ref == 'refs/heads/main' ||
48
- github.event_name == 'push' && github.ref == 'refs/heads/pre/beta' ||
49
- github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'main' ||
50
- github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'pre/beta'
59
+ if : |
60
+ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/pre/')) ||
61
+ github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged &&
62
+ (github.event.pull_request.base.ref == 'main' || startsWith(github.event.pull_request.base.ref, 'pre/'))
51
63
permissions :
52
64
contents : write
53
65
issues : write
59
71
with :
60
72
fetch-depth : 0
61
73
persist-credentials : false
74
+
75
+ - name : Restore build artifacts
76
+ uses : actions/cache@v3
77
+ with :
78
+ path : |
79
+ ./dist
80
+ ./build
81
+ key : ${{ runner.os }}-build-${{ github.sha }}
82
+
62
83
- name : Semantic Release
63
84
64
85
with :
0 commit comments