@@ -10,7 +10,23 @@ permissions:
10
10
11
11
jobs :
12
12
build-and-release :
13
- runs-on : ubuntu-latest
13
+ strategy :
14
+ matrix :
15
+ include :
16
+ - os : ubuntu-latest
17
+ platform : linux
18
+ arch : x64
19
+ - os : macos-13
20
+ platform : macos
21
+ arch : x64
22
+ - os : macos-14
23
+ platform : macos
24
+ arch : arm64
25
+ - os : windows-latest
26
+ platform : windows
27
+ arch : x64
28
+
29
+ runs-on : ${{ matrix.os }}
14
30
15
31
steps :
16
32
- name : Checkout code
27
43
- name : Create env
28
44
run : hatch env create
29
45
30
- - name : Source and build
46
+ - name : Build on Linux
47
+ if : matrix.platform == 'linux'
31
48
env :
32
49
HATCH_INDEX_USER : ${{ secrets.PYPI_USERNAME }}
33
50
HATCH_INDEX_AUTH : ${{ secrets.PYPI_PASSWORD }}
40
57
bash scripts/build/build_binaries_linux.sh
41
58
hatch publish -r test
42
59
60
+ - name : Build on macOS
61
+ if : matrix.platform == 'macos'
62
+ shell : bash
63
+ run : |
64
+ source $(hatch env find)/bin/activate
65
+ pip install uv
66
+ uv sync --active --extra dev
67
+ hatch build
68
+ pwsh scripts/resource-rcc-compile.ps1
69
+ pwsh scripts/build/build_binaries_macos_${{ matrix.arch }}.ps1
70
+
71
+ - name : Build on Windows
72
+ if : matrix.platform == 'windows'
73
+ shell : pwsh
74
+ run : |
75
+ $env_path = hatch env find
76
+ & "$env_path\Scripts\Activate.ps1"
77
+ pip install uv
78
+ uv sync --active --extra dev
79
+ hatch build
80
+ .\scripts\resource-rcc-compile.ps1
81
+ .\scripts\build\build_binaries_windows.ps1
82
+
83
+ - name : Upload build artifacts
84
+ uses : actions/upload-artifact@v4
85
+ with :
86
+ name : build-artifacts-${{ matrix.platform }}-${{ matrix.arch }}
87
+ path : |
88
+ dist/*.whl
89
+ dist/*.tar.gz
90
+ dist/*.zip
91
+ dist/*.dmg
92
+ dist/*.exe
93
+ dist/*.app
94
+ retention-days : 1
95
+
96
+ create-release :
97
+ needs : build-and-release
98
+ runs-on : ubuntu-latest
99
+
100
+ steps :
101
+ - name : Checkout code
102
+ uses : actions/checkout@v4
103
+
104
+ - name : Download all artifacts
105
+ uses : actions/download-artifact@v4
106
+ with :
107
+ path : dist-all
108
+ merge-multiple : true
109
+
43
110
- name : Get release tag
44
111
id : tag
45
112
run : echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
49
116
with :
50
117
tag_name : ${{ steps.tag.outputs.RELEASE_TAG }}
51
118
files : |
52
- dist/*.whl
53
- dist/*.tar.gz
54
- dist/*.zip
55
- dist/*.dmg
119
+ dist-all/*
56
120
env :
57
121
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments