-
Notifications
You must be signed in to change notification settings - Fork 28
174 lines (150 loc) · 5.38 KB
/
release.yaml
File metadata and controls
174 lines (150 loc) · 5.38 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Release
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
outputs:
released: ${{ steps.semantic_release.outputs.released }}
tag: ${{ steps.semantic_release.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref_name }}
token: ${{ secrets.GALILEO_AUTOMATION_GITHUB_TOKEN || github.token }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup UV
uses: astral-sh/setup-uv@v4
- name: Verify contrib wiring
run: python scripts/contrib_packages.py verify
- name: Python Semantic Release
id: semantic_release
uses: python-semantic-release/python-semantic-release@v10.5.3
with:
git_committer_name: galileo-automation
git_committer_email: ci@rungalileo.io
github_token: ${{ secrets.GALILEO_AUTOMATION_GITHUB_TOKEN || github.token }}
ssh_public_signing_key: ${{ secrets.GALILEO_AUTOMATION_SSH_PUBLIC_KEY }}
ssh_private_signing_key: ${{ secrets.GALILEO_AUTOMATION_SSH_PRIVATE_KEY }}
root_options: "-vv"
- name: Build Packages
if: steps.semantic_release.outputs.released == 'true'
run: |
uv sync
uv run python scripts/build.py all
- name: Stage built distributions
if: steps.semantic_release.outputs.released == 'true'
run: |
rm -rf release-dists
mkdir -p release-dists/models
mkdir -p release-dists/evaluators/builtin
mkdir -p release-dists/evaluators/contrib
mkdir -p release-dists/pypi/evaluators
mkdir -p release-dists/sdks/python
mkdir -p release-dists/server
cp -R models/dist release-dists/models/
cp -R evaluators/builtin/dist release-dists/evaluators/builtin/
cp evaluators/builtin/dist/* release-dists/pypi/evaluators/
cp -R sdks/python/dist release-dists/sdks/python/
cp -R server/dist release-dists/server/
for contrib_dir in evaluators/contrib/*/dist; do
contrib_name="$(basename "$(dirname "$contrib_dir")")"
mkdir -p "release-dists/evaluators/contrib/$contrib_name"
cp -R "$contrib_dir" "release-dists/evaluators/contrib/$contrib_name/"
cp "$contrib_dir"/* release-dists/pypi/evaluators/
done
- name: Upload built distributions
if: steps.semantic_release.outputs.released == 'true'
uses: actions/upload-artifact@v4
with:
name: release-dists
if-no-files-found: error
path: release-dists/
publish-models:
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.released == 'true'
permissions:
id-token: write
steps:
- name: Download built distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: .
- name: Publish agent-control-models to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: release-dists/models/dist/
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
publish-evaluators:
runs-on: ubuntu-latest
needs: [release, publish-models]
if: needs.release.outputs.released == 'true'
permissions:
id-token: write
steps:
- name: Download built distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: .
- name: Publish evaluator distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: release-dists/pypi/evaluators/
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
publish-sdk:
runs-on: ubuntu-latest
needs: [release, publish-evaluators]
if: >-
always() &&
needs.release.outputs.released == 'true' &&
needs.publish-evaluators.result == 'success'
permissions:
id-token: write
steps:
- name: Download built distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: .
- name: Publish agent-control-sdk to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: release-dists/sdks/python/dist/
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
upload-release-assets:
runs-on: ubuntu-latest
needs: [release, publish-sdk]
if: needs.release.outputs.released == 'true'
permissions:
contents: write
steps:
- name: Download built distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: .
- name: Upload to GitHub Release
uses: python-semantic-release/upload-to-gh-release@main
with:
github_token: ${{ secrets.GALILEO_AUTOMATION_GITHUB_TOKEN || github.token }}
tag: ${{ needs.release.outputs.tag }}
root_options: "-vv"
dist_glob: |
release-dists/models/dist/*
release-dists/evaluators/builtin/dist/*
release-dists/sdks/python/dist/*
release-dists/server/dist/*
release-dists/evaluators/contrib/*/dist/*