Repository navigation
175 lines (148 loc) · 5.85 KB
/
Copy pathrelease.yml
File metadata and controls
175 lines (148 loc) · 5.85 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish (e.g. v0.2.0)"
required: false
type: string
env:
GO_VERSION: "1.26"
REGISTRY: ghcr.io
IMAGE_BASE: ghcr.io/syscode-labs
jobs:
release-arch:
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: ubuntu-24.04
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate CRD manifests
run: make manifests
- name: Build context note
run: |
echo "::notice title=Build context::Building linux/${{ matrix.arch }} on native runner ${{ matrix.runner }}."
- name: Build and push operator image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile.operator
platforms: linux/${{ matrix.arch }}
push: true
tags: |
${{ env.IMAGE_BASE }}/imp-operator:${{ github.event.release.tag_name || inputs.release_tag }}-${{ matrix.arch }}
${{ env.IMAGE_BASE }}/imp-operator:latest-${{ matrix.arch }}
- name: Build and push node agent image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile.agent
platforms: linux/${{ matrix.arch }}
push: true
tags: |
${{ env.IMAGE_BASE }}/imp-agent:${{ github.event.release.tag_name || inputs.release_tag }}-${{ matrix.arch }}
${{ env.IMAGE_BASE }}/imp-agent:latest-${{ matrix.arch }}
- name: Build and push sandbox controller image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile.sandbox
platforms: linux/${{ matrix.arch }}
push: true
tags: |
${{ env.IMAGE_BASE }}/imp-sandbox:${{ github.event.release.tag_name || inputs.release_tag }}-${{ matrix.arch }}
${{ env.IMAGE_BASE }}/imp-sandbox:latest-${{ matrix.arch }}
- name: Build and push sandbox gateway image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile.gateway
platforms: linux/${{ matrix.arch }}
push: true
tags: |
${{ env.IMAGE_BASE }}/imp-sandbox-gateway:${{ github.event.release.tag_name || inputs.release_tag }}-${{ matrix.arch }}
${{ env.IMAGE_BASE }}/imp-sandbox-gateway:latest-${{ matrix.arch }}
merge-manifests:
runs-on: ubuntu-24.04
needs: [release-arch]
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create multi-arch manifests
shell: bash
run: |
set -euo pipefail
TAG="${{ github.event.release.tag_name || inputs.release_tag }}"
docker buildx imagetools create \
-t "${{ env.IMAGE_BASE }}/imp-operator:${TAG}" \
"${{ env.IMAGE_BASE }}/imp-operator:${TAG}-amd64" \
"${{ env.IMAGE_BASE }}/imp-operator:${TAG}-arm64"
docker buildx imagetools create \
-t "${{ env.IMAGE_BASE }}/imp-operator:latest" \
"${{ env.IMAGE_BASE }}/imp-operator:latest-amd64" \
"${{ env.IMAGE_BASE }}/imp-operator:latest-arm64"
docker buildx imagetools create \
-t "${{ env.IMAGE_BASE }}/imp-agent:${TAG}" \
"${{ env.IMAGE_BASE }}/imp-agent:${TAG}-amd64" \
"${{ env.IMAGE_BASE }}/imp-agent:${TAG}-arm64"
docker buildx imagetools create \
-t "${{ env.IMAGE_BASE }}/imp-agent:latest" \
"${{ env.IMAGE_BASE }}/imp-agent:latest-amd64" \
"${{ env.IMAGE_BASE }}/imp-agent:latest-arm64"
docker buildx imagetools create \
-t "${{ env.IMAGE_BASE }}/imp-sandbox:${TAG}" \
"${{ env.IMAGE_BASE }}/imp-sandbox:${TAG}-amd64" \
"${{ env.IMAGE_BASE }}/imp-sandbox:${TAG}-arm64"
docker buildx imagetools create \
-t "${{ env.IMAGE_BASE }}/imp-sandbox:latest" \
"${{ env.IMAGE_BASE }}/imp-sandbox:latest-amd64" \
"${{ env.IMAGE_BASE }}/imp-sandbox:latest-arm64"
docker buildx imagetools create \
-t "${{ env.IMAGE_BASE }}/imp-sandbox-gateway:${TAG}" \
"${{ env.IMAGE_BASE }}/imp-sandbox-gateway:${TAG}-amd64" \
"${{ env.IMAGE_BASE }}/imp-sandbox-gateway:${TAG}-arm64"
docker buildx imagetools create \
-t "${{ env.IMAGE_BASE }}/imp-sandbox-gateway:latest" \
"${{ env.IMAGE_BASE }}/imp-sandbox-gateway:latest-amd64" \
"${{ env.IMAGE_BASE }}/imp-sandbox-gateway:latest-arm64"
- uses: azure/setup-helm@v5
- name: Package and push sandbox Helm chart
shell: bash
run: |
set -euo pipefail
TAG="${{ github.event.release.tag_name || inputs.release_tag }}"
VERSION="${TAG#v}"
helm package charts/imp-sandbox --version "${VERSION}" --app-version "${VERSION}"
helm push "imp-sandbox-${VERSION}.tgz" oci://${{ env.IMAGE_BASE }}/charts