-
Notifications
You must be signed in to change notification settings - Fork 53
85 lines (73 loc) · 2.73 KB
/
release_core.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
name: Embedbase core release
on:
push:
branches:
- main
- next
- rc
paths:
- "embedbase/**"
# when pyproject.toml changes
- "pyproject.toml"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ github.event.head_commit.message }}
regex: "^Release core ([^ ]+)"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
- name: Install dependencies
run: |
poetry install
- name: Read EMBEDBASE_TEST_CONFIG JSON secret and write it to config.yaml
if: ${{ steps.regex-match.outputs.match != '' }}
env:
EMBEDBASE_TEST_CONFIG: ${{ secrets.EMBEDBASE_TEST_CONFIG }}
UNIT_TESTING_DATASET: release_core
run: |
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
chmod +x yq
echo $EMBEDBASE_TEST_CONFIG | yq -P > config.yaml
- name: Run tests
if: ${{ steps.regex-match.outputs.match != '' }}
run: |
docker run --rm --name pgvector -e POSTGRES_DB=embedbase -e POSTGRES_PASSWORD=localdb -p 5432:5432 -p 8080:8080 -d ankane/pgvector
while ! docker exec pgvector pg_isready -U postgres; do sleep 1; done
poetry run pytest --cov-report=html --cov=embedbase --ignore=sdk --ignore=hosted;poetry run coverage-badge -o assets/images/coverage.svg -f;docker stop pgvector
- name: Build package
if: ${{ steps.regex-match.outputs.match != '' }}
run: |
poetry build
- name: Publish to PyPI
if: ${{ steps.regex-match.outputs.match != '' }}
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish
- uses: rickstaa/action-create-tag@v1
if: ${{ steps.regex-match.outputs.match != '' }}
id: "tag_create"
with:
tag: core-${{ steps.regex-match.outputs.group1 }}
tag_exists_error: true
message: ${{ github.event.head_commit.message }}
- name: Create Release
if: ${{ steps.regex-match.outputs.match != '' }}
uses: softprops/action-gh-release@v1
with:
tag_name: core-${{ steps.regex-match.outputs.group1 }}
name: core-${{ steps.regex-match.outputs.group1 }}
draft: false
prerelease: false
# TODO: iterate on this changelog thing later
body: ${{ github.event.head_commit.message }}