-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (128 loc) · 3.68 KB
/
build_release.yml
File metadata and controls
154 lines (128 loc) · 3.68 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# This workflow automatically creates a GitHub release for the project on successful version update
name: Create a GitHub release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: "uv.lock"
enable-cache: true
python-version: "3.12"
version: "0.5.13"
- name: Install library and dependencies
run: |
uv sync --frozen
- uses: messense/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --sdist -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels
path: dist
windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: "uv.lock"
enable-cache: true
python-version: "3.12"
version: "0.5.13"
- name: Install library and dependencies
run: |
uv sync --frozen
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels
path: dist
macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: "uv.lock"
enable-cache: true
version: "0.5.13"
- name: Install library and dependencies
run: |
uv sync --frozen
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist --universal2 --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels
path: dist
release:
name: Release
runs-on: ubuntu-latest
needs: [ macos, windows, linux ]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Download Artifacts
uses: actions/download-artifact@v8
with:
name: wheels
- name: Check Version
uses: nowsprinting/check-version-format-action@v5
id: version
with:
prefix: 'v'
- name: Check for Pre-release
uses: haya14busa/action-cond@v1
id: is_prerelease
with:
cond: ${{ steps.version.outputs.prerelease != '' }}
if_true: true
if_false: false
- name: Get Newest Changelog
run: |
python -c "import re; from pathlib import Path; text=re.sub('<!--(.*?)-->', '', (Path.cwd() / 'CHANGELOG.md').read_text(), flags=re.DOTALL); start=text.find('_' * 79); (Path.cwd() / 'TEMP_CHANGELOG.md').write_text(text[start:text.find('_' * 79, start+1)])"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: ${{ steps.is_prerelease.outputs.value }}
body_path: ./TEMP_CHANGELOG.md
files: |
*.whl
*.tar.gz
- name: Publish to PyPI
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
with:
command: upload
args: --skip-existing *