Repository navigation
87 lines (71 loc) · 2.53 KB
/
Copy pathoperator_release.yml
File metadata and controls
87 lines (71 loc) · 2.53 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
name: "Operator: Release"
on:
push:
tags:
- "operator-v*"
env:
IMAGE_NAME: lmcache/lmcache-operator
permissions:
contents: write
defaults:
run:
shell: bash
working-directory: operator
jobs:
release:
name: Build, push, and release
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Login to Docker Hub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract version from tag
id: version
run: |
# Strip "operator-" prefix from tag to get version
VERSION="${GITHUB_REF_NAME#operator-}"
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: operator
platforms: linux/amd64
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
${{ env.IMAGE_NAME }}:latest
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: operator/go.mod
- name: Build installer manifest
run: make build-installer IMG=${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: "Operator ${{ steps.version.outputs.VERSION }}"
generate_release_notes: true
files: operator/dist/install.yaml
- name: Update latest release alias
uses: softprops/action-gh-release@v2
with:
tag_name: operator-latest
name: "Operator Latest (${{ steps.version.outputs.VERSION }})"
make_latest: false
body: |
Points to the latest stable operator release: `${{ steps.version.outputs.VERSION }}`
**Image:** `${{ env.IMAGE_NAME }}:latest`
```bash
kubectl apply -f https://github.com/${{ github.repository }}/releases/download/operator-latest/install.yaml
```
files: operator/dist/install.yaml