-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (72 loc) · 3.04 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
---
name: Release
on:
push:
branches:
- main
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
name: Release
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
permissions:
contents: write
pull-requests: write
steps:
- uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4.1.1
id: release
container:
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
name: Build (and Push) Container Image
needs:
- release
permissions:
contents: write
packages: write
steps:
- uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Upstream Tags
id: from_tag
run: |
POSTGRESQL_IMAGE=$(cat Dockerfile | grep 'FROM ghcr.io/cloudnative-pg/postgresql:')
POSTGRESQL_FROM_TAG=$(echo $POSTGRESQL_IMAGE | cut -d':' -f2 | cut -d'@' -f1)
echo "postgresql=${POSTGRESQL_FROM_TAG}" >> "$GITHUB_OUTPUT"
PGVECTO_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/pgvecto-rs-binary:')
PGVECTO_FROM_TAG=$(echo $PGVECTO_IMAGE | cut -d'-' -f4)
echo "pgvecto=${PGVECTO_FROM_TAG}" >> "$GITHUB_OUTPUT"
- uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/muhlba91/postgresql-pgvecto:latest
ghcr.io/muhlba91/postgresql-pgvecto:${{ github.sha }}
ghcr.io/muhlba91/postgresql-pgvecto:${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}
ghcr.io/muhlba91/postgresql-pgvecto:${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}-${{ needs.release.outputs.tag_name }}
build-args: |
CI_COMMIT_TIMESTAMP=${{ github.event.repository.updated_at }}
CI_COMMIT_SHA=${{ github.sha }}
CI_COMMIT_TAG=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}-${{ needs.release.outputs.tag_name }}
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}