Skip to content

Commit f935882

Browse files
committed
flows: add windows, mac
1 parent 216095f commit f935882

File tree

1 file changed

+70
-6
lines changed

1 file changed

+70
-6
lines changed

.github/workflows/release.yml

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,23 @@ permissions:
1010

1111
jobs:
1212
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 }}
1430

1531
steps:
1632
- name: Checkout code
@@ -27,7 +43,8 @@ jobs:
2743
- name: Create env
2844
run: hatch env create
2945

30-
- name: Source and build
46+
- name: Build on Linux
47+
if: matrix.platform == 'linux'
3148
env:
3249
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
3350
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
@@ -40,6 +57,56 @@ jobs:
4057
bash scripts/build/build_binaries_linux.sh
4158
hatch publish -r test
4259
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+
43110
- name: Get release tag
44111
id: tag
45112
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
@@ -49,9 +116,6 @@ jobs:
49116
with:
50117
tag_name: ${{ steps.tag.outputs.RELEASE_TAG }}
51118
files: |
52-
dist/*.whl
53-
dist/*.tar.gz
54-
dist/*.zip
55-
dist/*.dmg
119+
dist-all/*
56120
env:
57121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)