-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (87 loc) · 3.29 KB
/
Copy pathbuild-tiktoken.yml
File metadata and controls
97 lines (87 loc) · 3.29 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
# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on: https://github.com/openai/tiktoken/blob/0.14.0/.github/workflows/build_wheels.yml
name: Build tiktoken wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/tiktoken.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-tiktoken.yml'
- 'docs/packages/tiktoken.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-tiktoken.yml'
- 'docs/packages/tiktoken.yaml'
env:
UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/
UV_INDEX_STRATEGY: unsafe-best-match
UV_ONLY_BINARY: ':all:'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: tiktoken
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: py${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
# cibuildwheel builds linux wheels inside a manylinux container
# it also takes care of procuring the correct python version for us
# remove other os, and keep only riscv64
# os: [ubuntu-latest, windows-latest, macos-latest]
os : [ubuntu-24.04-riscv]
# we try to reduce the number of builds so only buidl for 3.12+
# see our documentation https://pypi.riseproject.dev/python-wheels/development.html#target-python-versions
# python-version: [39, 310, 311, 312, 313, 314, 314t, 315, 315t]
python-version: [ 312, 313, 314, 314t]
env:
TIKTOKEN_VERSION: ${{ matrix.version }}
steps:
# we need to checkout upstream source
- name: Checkout tiktoken ${{ env.TIKTOKEN_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
repository: openai/tiktoken
ref: ${{ env.TIKTOKEN_VERSION }}
persist-credentials: false
- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
env:
CIBW_BUILD: "cp${{ matrix.python-version}}-*"
# skip musllinux for now, because rustup.rs does not have installer for riscv64gc-unknown-linux-musl
CIBW_SKIP: "*-musllinux_*"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: tiktoken-${{ env.TIKTOKEN_VERSION }}-cp${{ matrix.python-version }}-manylinux_riscv64
path: ./wheelhouse/*.whl
publish:
name: Publish tiktoken ${{ matrix.version }}
needs: [setup, build_wheels]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
permissions:
contents: write
pull-requests: write
uses: $/.github/workflows/_publish-wheel.yml
with:
artifact-pattern: tiktoken-${{ matrix.version }}-*-manylinux_riscv64