-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (83 loc) · 2.45 KB
/
release-please.yml
File metadata and controls
96 lines (83 loc) · 2.45 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
name: release-please
run-name: promptfoo-python release by @${{ github.actor }}
concurrency:
group: release-please-${{ github.ref }}
cancel-in-progress: false
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
build:
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
needs: release-please
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Pin Python version
run: uv python pin 3.12
- name: Install dependencies
run: uv sync --extra dev
- name: Run tests
run: |
# Quick smoke test before publishing
uv run python -c "import promptfoo; print(promptfoo.__version__)"
- name: Build package
run: uv build
- name: Verify package version matches release
run: |
EXPECTED_VERSION="${{ needs.release-please.outputs.version }}"
if ls dist/*-${EXPECTED_VERSION}-*.whl 1> /dev/null 2>&1; then
echo "✓ Package version ${EXPECTED_VERSION} matches release"
else
echo "ERROR: Package version mismatch!"
echo "Expected version: ${EXPECTED_VERSION}"
echo "Built packages:"
ls -la dist/
exit 1
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: dist
path: dist/
publish-pypi:
if: needs.release-please.outputs.release_created == 'true'
needs: [build, release-please]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/promptfoo/
permissions:
contents: read
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v7
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true