Skip to content

Commit c39da7b

Browse files
committed
Switch to public repo
0 parents  commit c39da7b

455 files changed

Lines changed: 201617 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: client-components
2+
permissions:
3+
contents: read
4+
packages: write
5+
on:
6+
push:
7+
tags:
8+
- "v*.*.*"
9+
branches:
10+
- b-*
11+
- main
12+
- dev
13+
jobs:
14+
build:
15+
name: build-${{ matrix.component }}-${{ matrix.arch }}
16+
runs-on: ${{ matrix.runner }}
17+
strategy:
18+
matrix:
19+
component: [cordium]
20+
arch:
21+
- amd64
22+
- arm64
23+
include:
24+
- arch: amd64
25+
platform: linux/amd64
26+
runner: ubuntu-24.04
27+
- arch: arm64
28+
platform: linux/arm64
29+
runner: ubuntu-24.04-arm
30+
steps:
31+
- name: Check out code into the Go module directory
32+
uses: actions/checkout@v4
33+
34+
- name: Inject slug/short variables
35+
uses: rlespinasse/github-slug-action@v4
36+
37+
- name: Set ENV variables
38+
env:
39+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
40+
run: for v in `cat .github/workflows/env` ; do echo "::set-env name=${v%%=*}::${v##*=}" ; done
41+
42+
- name: Set is latest
43+
run: |
44+
IS_LATEST=$(git tag | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" | sort -r --version-sort | head -n1)
45+
echo $IS_LATEST
46+
if [ "$IS_LATEST" = ${{ env.GITHUB_REF_SLUG }} ]; then
47+
echo "V_IS_LATEST=true" >> $GITHUB_ENV
48+
else
49+
echo "V_IS_LATEST=false" >> $GITHUB_ENV
50+
fi
51+
52+
- name: Docker meta
53+
id: meta
54+
uses: docker/metadata-action@v4
55+
with:
56+
images: ${{env.V_CONTAINER_REGISTRY}}/${{env.V_ORG}}/${{matrix.component}}
57+
flavor: |
58+
latest=false
59+
prefix=
60+
suffix=-${{ matrix.arch }}
61+
tags: |
62+
type=ref,event=branch
63+
type=ref,event=pr
64+
type=semver,pattern={{version}}
65+
type=semver,pattern={{major}}.{{minor}}
66+
67+
- name: Set up Docker Buildx
68+
uses: docker/setup-buildx-action@v3
69+
70+
- name: Login to Github Registry
71+
uses: docker/login-action@v3
72+
with:
73+
registry: ${{env.V_CONTAINER_REGISTRY}}
74+
username: ${{ github.repository_owner }}
75+
password: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- name: Build and push
78+
uses: docker/build-push-action@v5
79+
with:
80+
context: .
81+
file: client/${{matrix.component}}/Dockerfile
82+
platforms: ${{ matrix.platform }}
83+
push: true
84+
tags: ${{ steps.meta.outputs.tags }}
85+
labels: ${{ steps.meta.outputs.labels }}
86+
provenance: false
87+
88+
create-manifest:
89+
name: Create manifest for ${{ matrix.component }}
90+
needs: build
91+
runs-on: ubuntu-24.04
92+
strategy:
93+
matrix:
94+
component: [cordium]
95+
steps:
96+
- name: Check out code
97+
uses: actions/checkout@v4
98+
99+
- name: Inject slug/short variables
100+
uses: rlespinasse/github-slug-action@v4
101+
102+
- name: Set ENV variables
103+
env:
104+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
105+
run: for v in `cat .github/workflows/env` ; do echo "::set-env name=${v%%=*}::${v##*=}" ; done
106+
107+
- name: Set is latest
108+
run: |
109+
IS_LATEST=$(git tag | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" | sort -r --version-sort | head -n1)
110+
echo $IS_LATEST
111+
if [ "$IS_LATEST" = ${{ env.GITHUB_REF_SLUG }} ]; then
112+
echo "V_IS_LATEST=true" >> $GITHUB_ENV
113+
else
114+
echo "V_IS_LATEST=false" >> $GITHUB_ENV
115+
fi
116+
117+
- name: Docker meta
118+
id: meta
119+
uses: docker/metadata-action@v4
120+
with:
121+
images: ${{env.V_CONTAINER_REGISTRY}}/${{env.V_ORG}}/${{matrix.component}}
122+
flavor: |
123+
latest=${{env.V_IS_LATEST}}
124+
prefix=
125+
suffix=
126+
tags: |
127+
type=ref,event=branch
128+
type=ref,event=pr
129+
type=semver,pattern={{version}}
130+
type=semver,pattern={{major}}.{{minor}}
131+
132+
- name: Set up Docker Buildx
133+
uses: docker/setup-buildx-action@v3
134+
135+
- name: Log in to registry
136+
uses: docker/login-action@v3
137+
with:
138+
registry: ${{env.V_CONTAINER_REGISTRY}}
139+
username: ${{ github.repository_owner }}
140+
password: ${{ secrets.GITHUB_TOKEN }}
141+
142+
- name: Create and push manifest with annotations
143+
env:
144+
LABELS: ${{ steps.meta.outputs.labels }}
145+
BASE_IMAGE: ${{env.V_CONTAINER_REGISTRY}}/${{env.V_ORG}}/${{matrix.component}}
146+
VERSION: ${{ steps.meta.outputs.version }}
147+
run: |
148+
TAGS="${{ steps.meta.outputs.tags }}"
149+
150+
ANNOTATIONS=()
151+
while IFS='=' read -r key value; do
152+
if [ -n "$key" ] && [ -n "$value" ]; then
153+
ANNOTATIONS+=("--annotation" "index:${key}=${value}")
154+
fi
155+
done <<< "$LABELS"
156+
157+
for TAG in $TAGS; do
158+
echo "Creating manifest for $TAG"
159+
docker buildx imagetools create \
160+
"${ANNOTATIONS[@]}" \
161+
-t "$TAG" \
162+
"${BASE_IMAGE}:${VERSION}-amd64" \
163+
"${BASE_IMAGE}:${VERSION}-arm64"
164+
done
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
name: cluster-components
2+
permissions:
3+
contents: read
4+
packages: write
5+
on:
6+
push:
7+
tags:
8+
- "v*.*.*"
9+
branches:
10+
- b-*
11+
- main
12+
- dev
13+
14+
jobs:
15+
build:
16+
name: Build ${{ matrix.component }}-${{ matrix.arch }}
17+
runs-on: ${{ matrix.runner }}
18+
strategy:
19+
matrix:
20+
component:
21+
[
22+
workspace,
23+
portal,
24+
nocturne,
25+
apiserver,
26+
supervisor,
27+
genesis,
28+
rscserver,
29+
vigil,
30+
]
31+
arch:
32+
- amd64
33+
# - arm64
34+
include:
35+
- arch: amd64
36+
platform: linux/amd64
37+
runner: ubuntu-24.04
38+
# - arch: arm64
39+
# platform: linux/arm64
40+
# runner: ubuntu-24.04-arm
41+
steps:
42+
- name: Check out code into the Go module directory
43+
uses: actions/checkout@v4
44+
45+
- name: Inject slug/short variables
46+
uses: rlespinasse/github-slug-action@v4
47+
48+
- name: Set ENV variables
49+
env:
50+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
51+
run: for v in `cat .github/workflows/env` ; do echo "::set-env name=${v%%=*}::${v##*=}" ; done
52+
53+
- name: Set is latest
54+
run: |
55+
IS_LATEST=$(git tag | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" | sort -r --version-sort | head -n1)
56+
echo $IS_LATEST
57+
if [ "$IS_LATEST" = ${{ env.GITHUB_REF_SLUG }} ]; then
58+
echo "V_IS_LATEST=true" >> $GITHUB_ENV
59+
else
60+
echo "V_IS_LATEST=false" >> $GITHUB_ENV
61+
fi
62+
63+
- name: Docker meta
64+
id: meta
65+
uses: docker/metadata-action@v4
66+
with:
67+
images: ${{env.V_CONTAINER_REGISTRY}}/${{env.V_ORG}}/octelium-${{matrix.component}}
68+
flavor: |
69+
latest=false
70+
prefix=
71+
suffix=-${{ matrix.arch }}
72+
tags: |
73+
type=ref,event=branch
74+
type=ref,event=pr
75+
type=semver,pattern={{version}}
76+
type=semver,pattern={{major}}.{{minor}}
77+
78+
- name: Set up Docker Buildx
79+
uses: docker/setup-buildx-action@v3
80+
81+
- name: Log in to registry
82+
uses: docker/login-action@v3
83+
with:
84+
registry: ${{env.V_CONTAINER_REGISTRY}}
85+
username: ${{ github.repository_owner }}
86+
password: ${{ secrets.GITHUB_TOKEN }}
87+
88+
- name: Build and push
89+
uses: docker/build-push-action@v5
90+
with:
91+
context: .
92+
file: cluster/${{matrix.component}}/Dockerfile
93+
platforms: ${{ matrix.platform }}
94+
push: true
95+
tags: ${{ steps.meta.outputs.tags }}
96+
labels: ${{ steps.meta.outputs.labels }}
97+
provenance: false
98+
99+
create-manifest:
100+
name: Create manifest for ${{ matrix.component }}
101+
needs: build
102+
runs-on: ubuntu-24.04
103+
strategy:
104+
matrix:
105+
component:
106+
[
107+
workspace,
108+
portal,
109+
nocturne,
110+
apiserver,
111+
supervisor,
112+
genesis,
113+
rscserver,
114+
vigil,
115+
]
116+
steps:
117+
- name: Check out code
118+
uses: actions/checkout@v4
119+
120+
- name: Inject slug/short variables
121+
uses: rlespinasse/github-slug-action@v4
122+
123+
- name: Set ENV variables
124+
env:
125+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
126+
run: for v in `cat .github/workflows/env` ; do echo "::set-env name=${v%%=*}::${v##*=}" ; done
127+
128+
- name: Set is latest
129+
run: |
130+
IS_LATEST=$(git tag | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" | sort -r --version-sort | head -n1)
131+
echo $IS_LATEST
132+
if [ "$IS_LATEST" = ${{ env.GITHUB_REF_SLUG }} ]; then
133+
echo "V_IS_LATEST=true" >> $GITHUB_ENV
134+
else
135+
echo "V_IS_LATEST=false" >> $GITHUB_ENV
136+
fi
137+
138+
- name: Docker meta
139+
id: meta
140+
uses: docker/metadata-action@v4
141+
with:
142+
images: ${{env.V_CONTAINER_REGISTRY}}/${{env.V_ORG}}/octelium-${{matrix.component}}
143+
flavor: |
144+
latest=${{env.V_IS_LATEST}}
145+
prefix=
146+
suffix=
147+
tags: |
148+
type=ref,event=branch
149+
type=ref,event=pr
150+
type=semver,pattern={{version}}
151+
type=semver,pattern={{major}}.{{minor}}
152+
153+
- name: Set up Docker Buildx
154+
uses: docker/setup-buildx-action@v3
155+
156+
- name: Log in to registry
157+
uses: docker/login-action@v3
158+
with:
159+
registry: ${{env.V_CONTAINER_REGISTRY}}
160+
username: ${{ github.repository_owner }}
161+
password: ${{ secrets.GITHUB_TOKEN }}
162+
163+
- name: Create and push manifest with annotations
164+
env:
165+
LABELS: ${{ steps.meta.outputs.labels }}
166+
BASE_IMAGE: ${{env.V_CONTAINER_REGISTRY}}/${{env.V_ORG}}/octelium-${{matrix.component}}
167+
VERSION: ${{ steps.meta.outputs.version }}
168+
run: |
169+
TAGS="${{ steps.meta.outputs.tags }}"
170+
171+
ANNOTATIONS=()
172+
while IFS='=' read -r key value; do
173+
if [ -n "$key" ] && [ -n "$value" ]; then
174+
ANNOTATIONS+=("--annotation" "index:${key}=${value}")
175+
fi
176+
done <<< "$LABELS"
177+
178+
for TAG in $TAGS; do
179+
echo "Creating manifest for $TAG"
180+
docker buildx imagetools create \
181+
"${ANNOTATIONS[@]}" \
182+
-t "$TAG" \
183+
"${BASE_IMAGE}:${VERSION}-amd64" \
184+
"${BASE_IMAGE}:${VERSION}-arm64"
185+
done

.github/workflows/env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
V_ORG=octelium
2+
V_CONTAINER_REGISTRY=ghcr.io
3+
GO_VERSION=1.25.7

0 commit comments

Comments
 (0)