-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (83 loc) · 2.97 KB
/
actions.yml
File metadata and controls
84 lines (83 loc) · 2.97 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
on:
- workflow_dispatch
name: release
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 , windows-2022, macos-13 ]
steps:
- uses: actions/checkout@v4
- name: Get proton-python-driver tag
id: get_tag_name
if: ${{ !startsWith( matrix.os, 'windows' ) }}
run: |
VERSION=`grep '^VERSION' proton_driver/__init__.py \
| sed 's/^VERSION = (//g' \
| sed 's/).*//g' \
| sed 's/, /./g'`
VERSION=v$VERSION
echo $VERSION
echo "tag_name=$VERSION" >> $GITHUB_OUTPUT
- name: Get proton-python-driver tag(windows)
if: ${{ startsWith( matrix.os, 'windows' ) }}
id: get_tag_name_win
shell: pwsh
run: |
$VERSION=((Get-Content proton_driver/__init__.py | Select-String -Pattern '^VERSION') -replace "^VERSION = \((\d+), (\d+), (\d+)\)","v`$1.`$2.`$3")
Write-Output $VERSION
Write-Output "tag_name=$VERSION" >> $env:GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ startsWith( matrix.os, 'ubuntu' ) }}
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Build wheels
# v3.4.1 is the first stable line with CPython 3.14 (incl. cp314t) wheel support.
# v2.21.3 predates 3.14 and would silently skip cp314/cp314t targets.
uses: pypa/cibuildwheel@v3.4.1
with:
package-dir: .
output-dir: wheelhouse
config-file: pyproject.toml
- name: Release wheels
uses: softprops/action-gh-release@v2
with:
files: wheelhouse/*.whl
generate_release_notes: true
tag_name: ${{ join(steps.*.outputs.tag_name, '') }}
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
# v4 requires unique artifact names per job; matrix.os keeps them distinct.
name: python-package-distributions-${{ matrix.os }}
path: wheelhouse/*.whl
publish-to-pypi:
name: Publish Python distribution to PyPI
needs:
- build_wheels
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/proton-driver
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
# v4 download without a name arg fetches every matching artifact; the pattern
# joins the per-OS uploads from build_wheels back into a single dist/ tree.
pattern: python-package-distributions-*
merge-multiple: true
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
username: __token__
password: ${{ secrets.PYPI_TOKEN }}