Skip to content

Commit cc868a4

Browse files
committed
chore(ci): updated matrix release workflow
1 parent 01aeaf2 commit cc868a4

File tree

1 file changed

+47
-14
lines changed

1 file changed

+47
-14
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,68 @@ on:
44
push:
55
tags:
66
- "v*"
7+
workflow_dispatch:
78

89
permissions:
910
id-token: write
1011
contents: write
1112

1213
jobs:
13-
build:
14-
runs-on: ubuntu-latest
15-
14+
build-wheels:
15+
strategy:
16+
matrix:
17+
platform:
18+
- runs-on: ubuntu-24.04
19+
arch: x86_64
20+
- runs-on: buildjet-2vcpu-ubuntu-2204-arm
21+
arch: arm64
22+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
23+
runs-on: ${{ matrix.platform.runs-on }}
1624
steps:
1725
- uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
26+
- uses: astral-sh/setup-uv@v4
2027
- uses: actions/setup-python@v2
2128
with:
22-
python-version: "3.11"
29+
python-version: ${{ matrix.python-version }}
2330

24-
- name: Install dependencies
25-
run: pip install hatch
31+
- name: Install valgrind
32+
run: sudo apt-get install valgrind -y
2633

2734
- name: Build the library
28-
run: hatch build
35+
run: uv build --wheel --out-dir dist/
36+
37+
- uses: actions/upload-artifact@v4
38+
with:
39+
name: wheel-${{ matrix.python-version }}-${{ runner.os }}
40+
path: dist/*.whl
41+
42+
publish-wheels:
43+
needs: build-wheels
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/download-artifact@v4
47+
with:
48+
merge-multiple: true
49+
path: dist/
50+
- uses: actions/checkout@v4
51+
- uses: astral-sh/setup-uv@v4
52+
- uses: actions/setup-python@v2
53+
with:
54+
python-version: "3.12"
55+
- name: Build the source dist
56+
run: uv build --sdist --out-dir dist/
57+
58+
- name: List artifacts
59+
run: ls -l dist/
2960

30-
- name: Publish package distributions to PyPI
31-
uses: pypa/gh-action-pypi-publish@release/v1
61+
- if: github.event_name == 'push'
62+
name: Publish to PyPI
63+
run: uv publish --trusted-publishing=always dist/*
3264

33-
- name: Create a draft release
65+
- if: github.event_name == 'push'
66+
name: Create a draft release
3467
run: |
35-
NEW_VERSION=$(hatch project metadata | jq -r '.version')
36-
gh release create v$NEW_VERSION --title "v$NEW_VERSION" --generate-notes -d
68+
VERSION="${{ github.ref_name }}"
69+
gh release create $VERSION --title $VERSION --generate-notes -d
3770
env:
3871
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)