-
Notifications
You must be signed in to change notification settings - Fork 17
131 lines (109 loc) · 3.35 KB
/
release.yml
File metadata and controls
131 lines (109 loc) · 3.35 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
name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag (e.g. v0.1.0)'
required: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
cache-dependency-path: ui/package-lock.json
- name: Set version from tag
run: uv version "${{ github.event.inputs.tag || github.ref_name }}" --package agentevals-cli
- name: Build core and bundled wheels
run: make release
- uses: actions/upload-artifact@v7
with:
name: wheels
path: |
dist/core/*.whl
dist/bundle/*.whl
github-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v8
with:
name: wheels
path: dist/
- uses: softprops/action-gh-release@v2.5.0
with:
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
files: dist/**/*.whl
generate_release_notes: true
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
cache-dependency-path: ui/package-lock.json
# Same bundle as `make release` / `build-bundle`: wheel must include ui/dist in src/agentevals/_static
# (see [tool.hatch.build] artifacts in pyproject.toml).
- name: Release Python package (wheel + sdist with bundled UI)
env:
VERSION: ${{ github.event.inputs.tag || github.ref_name }}
run: |
uv sync --package agentevals-cli --all-extras
uv version "$VERSION" --package agentevals-cli
make build-ui
rm -rf src/agentevals/_static
cp -r ui/dist src/agentevals/_static
rm -rf dist
uv build --package agentevals-cli
uv publish dist/* --token ${{ secrets.PYPI_TOKEN }}
rm -rf src/agentevals/_static
push-docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Set appVersion in Chart.yaml
run: |
VERSION="${TAG#v}"
sed -i "s/^appVersion:.*/appVersion: \"$VERSION\"/" charts/agentevals/Chart.yaml
env:
TAG: ${{ github.event.inputs.tag || github.ref_name }}
- name: Build and push
run: |
VERSION="${TAG#v}"
make build-docker \
DOCKER_REGISTRY="ghcr.io/${{ github.repository_owner }}" \
DOCKER_TAG="$VERSION"
env:
TAG: ${{ github.event.inputs.tag || github.ref_name }}