-
Notifications
You must be signed in to change notification settings - Fork 7.5k
137 lines (117 loc) · 4.1 KB
/
release.yml
File metadata and controls
137 lines (117 loc) · 4.1 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
name: Publish packages
on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- main
permissions:
contents: write
id-token: write
attestations: write
jobs:
publish-core:
if: github.repository == 'run-llama/llama_index' && (github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.event.pull_request.head.ref == vars.RELEASE_BRANCH_NAME))
runs-on: ubuntu-latest
outputs:
version: ${{ steps.build-publish-core.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install uv and set python version
uses: astral-sh/setup-uv@v7
with:
python-version: "3.10"
- name: Install core dependencies
working-directory: llama-index-core
run: |
uv sync
- name: Populate nltk/tiktoken cache
working-directory: llama-index-core
run: |
uv run python -c "from llama_index.core.utils import globals_helper; print(globals_helper.stopwords); print(globals_helper.punkt_tokenizer)"
uv run python -c "from llama_index.core.utils import get_tokenizer; print(get_tokenizer())"
uv run python -c "from llama_index.core.utils import get_tokenizer; print(get_tokenizer('gpt-5-mini'))"
- name: Generate build provenance attestations
uses: actions/attest-build-provenance@v4
id: attest
with:
subject-path: "llama-index-core/llama_index/core/_static/**/*"
- name: Ensure tests pass
working-directory: llama-index-core
run: |
uv run pytest tests
- name: Build and publish llama-index-core
working-directory: llama-index-core
run: |
uv sync
uv build
uv publish --token ${{ secrets.LLAMA_INDEX_PYPI_TOKEN }}
- name: Check PyPI is ready
working-directory: llama-dev
timeout-minutes: 5
run: |
until uv run -- llama-dev --repo-root .. release check
do
echo "Check failed. Retrying in 10 seconds..."
sleep 10
done
notify-workflows-py:
name: Trigger llama-index-core bump in workflows-py
runs-on: ubuntu-latest
needs: publish-core
steps:
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.CI_BOT_APP_ID }}
private-key: ${{ secrets.CI_BOT_PRIVATE_KEY }}
owner: run-llama
- name: Trigger repository_dispatch
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ steps.app-token.outputs.token }}
repository: run-llama/workflows-py
event-type: llama-index-core-release
build-n-publish:
name: Build and publish 'llama-index' to PyPI
runs-on: ubuntu-latest
needs: publish-core
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install uv and set python version
uses: astral-sh/setup-uv@v7
with:
python-version: "3.10"
- name: Get version
id: get_version
working-directory: llama-dev
run: |
VERSION=$(uv run -- llama-dev --repo-root .. pkg info --json . | jq -r .version)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Install deps
shell: bash
run: uv sync
- name: Build and publish to pypi
run: |
uv sync
uv build
uv publish --token ${{ secrets.LLAMA_INDEX_PYPI_TOKEN }}
- name: Generate Release Notes
uses: CSchoel/release-notes-from-changelog@v1
with:
version: "$(date +'%Y-%m-%d')"
begin-pattern: "/^## \\[$(date +'%Y-%m-%d')\\]/"
end-pattern: "/^## \\[/"
working-directory: "."
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ steps.get_version.outputs.version }}" \
--title "v${{ steps.get_version.outputs.version }}" \
--notes-file RELEASE.md \
dist/*.tar.gz