-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (95 loc) · 3.37 KB
/
release.yaml
File metadata and controls
105 lines (95 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Release
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
jobs:
release-build:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- {"runner": "ubuntu-latest", "os": "linux", "target": "x86_64"}
- {"runner": "ubuntu-latest", "os": "linux", "target": "aarch64"}
- {"runner": "windows-latest", "os": "win", "target": "x86_64"}
- {"runner": "windows-latest", "os": "win", "target": "arm64"}
- {"runner": "macos-latest", "os": "macos", "target": "x86_64"}
- {"runner": "macos-latest", "os": "macos", "target": "arm64"}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: build release distributions
env:
CIBW_ARCHS: ${{ matrix.platform.target }}
CIBW_PLATFORM: ${{ matrix.platform.os }}
run: |
uv build
- name: upload dists
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.os }}-${{ matrix.platform.target }}
path: dist/
publish-pypi:
runs-on: ubuntu-latest
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
needs:
- release-build
permissions:
id-token: write
strategy:
matrix:
platform:
- {"runner": "ubuntu-latest", "os": "linux", "target": "x86_64"}
- {"runner": "ubuntu-latest", "os": "linux", "target": "aarch64"}
- {"runner": "windows-latest", "os": "win", "target": "x86_64"}
- {"runner": "windows-latest", "os": "win", "target": "arm64"}
- {"runner": "macos-latest", "os": "macos", "target": "x86_64"}
- {"runner": "macos-latest", "os": "macos", "target": "arm64"}
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: ${{ matrix.platform.os }}-${{ matrix.platform.target }}
path: dist/
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Publish release distributions to PyPI
run: uv publish -v
publish-release:
runs-on: ubuntu-latest
name: Publish to GitHub
if: startsWith(github.ref, 'refs/tags/')
needs:
- release-build
permissions:
contents: write
strategy:
matrix:
platform:
- {"runner": "ubuntu-latest", "os": "linux", "target": "x86_64"}
- {"runner": "ubuntu-latest", "os": "linux", "target": "aarch64"}
- {"runner": "windows-latest", "os": "win", "target": "x86_64"}
- {"runner": "windows-latest", "os": "win", "target": "arm64"}
- {"runner": "macos-latest", "os": "macos", "target": "x86_64"}
- {"runner": "macos-latest", "os": "macos", "target": "arm64"}
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.platform.os }}-${{ matrix.platform.target }}
path: dist/
- name: Get tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Publish to GitHub
uses: softprops/action-gh-release@v2
with:
draft: true
files: dist/*
tag_name: ${{ env.RELEASE_VERSION }}