-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (109 loc) · 3.09 KB
/
python-publish.yml
File metadata and controls
125 lines (109 loc) · 3.09 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
name: Publish Python Package
on:
release:
types: [published]
concurrency:
group: pypi-publish-${{ github.event.release.tag_name || github.ref }}
cancel-in-progress: false
permissions:
contents: read
jobs:
verify-ci:
if: ${{ github.event.release.prerelease == false }}
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
outputs:
head_sha: ${{ steps.sha.outputs.head_sha }}
steps:
- name: Checkout release tag
uses: actions/checkout@v5
with:
ref: ${{ github.event.release.tag_name }}
- name: Resolve release commit SHA
id: sha
run: echo "head_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Verify CI passed for release commit
env:
CI_HEAD_SHA: ${{ steps.sha.outputs.head_sha }}
GITHUB_TOKEN: ${{ github.token }}
run: python ./scripts/workflows/verify_ci_release.py
linux-cli-validation:
needs: verify-ci
uses: ./.github/workflows/linux-python-3_13-cli-validation.yml
with:
run_accurate_research: false
darwin-validation:
needs: verify-ci
uses: ./.github/workflows/darwin-x86_64-validation.yml
macos-mps-validation:
needs: verify-ci
uses: ./.github/workflows/macos15-mps-validation.yml
with:
run_accurate_research: false
selfhosted-gpu-validation:
needs: verify-ci
uses: ./.github/workflows/linux-selfhosted-gpu-validation.yml
with:
run_cuda: true
run_xpu: false
run_accurate_research: false
full-dataset-quality-gate:
needs: verify-ci
uses: ./.github/workflows/full-dataset-quality-gate-regression.yml
with:
run_training: true
build-distributions:
needs:
[
verify-ci,
linux-cli-validation,
darwin-validation,
macos-mps-validation,
]
runs-on: ubuntu-latest
steps:
- name: Checkout release commit
uses: actions/checkout@v5
with:
ref: ${{ needs.verify-ci.outputs.head_sha }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build distributions
run: |
python -m pip install --upgrade pip build twine
python -m build
- name: Check distribution metadata
run: python -m twine check --strict dist/*
- name: Upload distributions artifact
uses: actions/upload-artifact@v7
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
needs:
[
verify-ci,
linux-cli-validation,
darwin-validation,
macos-mps-validation,
build-distributions,
]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ser
permissions:
actions: read
id-token: write
steps:
- name: Download distributions artifact
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1