-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (102 loc) · 3.57 KB
/
release.yml
File metadata and controls
120 lines (102 loc) · 3.57 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
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.25"
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@v6
- uses: actions/setup-go@v6
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@v6
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@v6
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 }}
merge-manifests:
runs-on: ubuntu-24.04
needs: [release-arch]
permissions:
packages: write
contents: read
steps:
- 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"