-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (88 loc) · 2.51 KB
/
release.yml
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
name: Build and publish package
on:
push:
tags:
- 'v*.*.*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
tests:
uses: ./.github/workflows/ci.yml
build:
name: Build package and upload artifacts
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install hatch
uses: pypa/hatch@install
- name: Check versions match
run: |
pkg_version=$(hatch version)
tag_version=${GITHUB_REF#refs/tags/v}
if [ "$pkg_version" != "$tag_version" ]; then
echo "Package version ($pkg_version) does not match git tag version ($tag_version)"
exit 1
fi
- name: Build package
run: hatch build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cleanlab-codex
path: dist/*
if-no-files-found: error
publish-pypi:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: cleanlab-codex
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
upload-release:
name: Upload release to GitHub
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: cleanlab-codex
path: dist
- name: Upload release
uses: softprops/action-gh-release@v1
with:
files: dist/*
body: ${{ steps.extract-release-notes.outputs.release_notes }}
update-docs:
name: Trigger docs rebuild
needs: publish-pypi
runs-on: ubuntu-latest
steps:
- name: Trigger docs rebuild
run: |
curl -X POST https://api.github.com/repos/cleanlab/cleanlab-studio-docs/dispatches \
-H 'Accept: application/vnd.github+json' \
-H 'Authorization: Bearer ${{ secrets.REBUILD_DOCS_TOKEN }}' \
--data '{"event_type": "docs_rebuild"}'