-
Notifications
You must be signed in to change notification settings - Fork 179
96 lines (82 loc) · 2.68 KB
/
release-please.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
95
96
on:
push:
branches:
- main
permissions:
id-token: write
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
pgai_release_created: ${{ steps.release.outputs['projects/pgai--release_created'] }}
tag_name: ${{ steps.release.outputs['projects/pgai--tag_name'] }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-pypi:
name: Publish to PyPi
needs: release-please
if: needs.release-please.outputs.pgai_release_created
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.29"
enable-cache: true
cache-dependency-glob: "./projects/pgai/uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "./projects/pgai/.python-version"
- name: Build the project
working-directory: ./projects/pgai
run: uv build --no-sources
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./projects/pgai/dist
release-docker:
name: Publish to Docker Hub
needs: release-please
if: needs.release-please.outputs.pgai_release_created
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up RELEASE_TAG
run: |
echo "RELEASE_TAG=${{ needs.release-please.outputs.tag_name }}" | sed 's/pgai-//' >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: timescale/pgai-vectorizer-worker
labels: |
org.opencontainers.image.description=A worker for self-hosted pgai vectorizers
org.opencontainers.image.title=pgai-vectorizer-worker
tags: |
type=raw,value=${{ env.RELEASE_TAG }}
type=raw,value=latest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.ORG_DOCKER_HUB_USERNAME }}
password: ${{ secrets.ORG_DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:projects/pgai"
push: true
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64