-
Notifications
You must be signed in to change notification settings - Fork 37
139 lines (119 loc) · 4.89 KB
/
kagome-builder-deb.yaml
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
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#
name: Kagome Builder | Ubuntu (24.04_LTS)
on:
# schedule:
# - cron: '0 2 * * 0' # Every Sunday at 2:00 AM
workflow_dispatch:
inputs:
kagome_image_rebuild:
description: 'Rebuild Kagome Builder image'
required: false
default: 'false'
type: 'boolean'
runtime_cache_rebuild:
description: 'Rebuild Kagome Runtime cache'
required: false
default: 'false'
type: 'boolean'
builder_latest_tag:
description: 'Custom Kagome Builder tag'
default: 'latest'
required: false
type: 'string'
zombie_tester_latest_tag:
description: 'Custom Zombie Tester tag'
default: 'latest'
required: false
type: 'string'
env:
DOCKER_REGISTRY_PATH: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/kagome-dev/
BUILDER_LATEST_TAG: ${{ github.event.inputs.builder_latest_tag || 'latest' }}
TESTER_LATEST_TAG: ${{ github.event.inputs.zombie_tester_latest_tag || 'latest' }}
jobs:
build_kagome_builder:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name : "Authenticate with Google Cloud"
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: "Set up Cloud SDK"
uses: 'google-github-actions/setup-gcloud@v2'
- name: "Configure Docker for GCR"
run: |
gcloud auth configure-docker --quiet
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet
- name: "Check if image tag exists"
id: check-tag
working-directory: ./housekeeping/docker/kagome-dev
run: |
IMAGE_TAG=$(make builder_image_tag)
KAGOME_BUILDER_IMAGE=${DOCKER_REGISTRY_PATH}kagome_builder_deb:${IMAGE_TAG}
TAG_EXISTS=$(docker manifest inspect ${KAGOME_BUILDER_IMAGE} > /dev/null 2>&1 && echo "true" || echo "false")
echo "exists=$TAG_EXISTS" >> $GITHUB_ENV
echo "kagome_builder=$KAGOME_BUILDER_IMAGE" >> $GITHUB_OUTPUT
- name: "Build Kagome Builder"
working-directory: ./housekeeping/docker/kagome-dev
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true'
run: make kagome_builder \
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \
BUILDER_LATEST_TAG=${BUILDER_LATEST_TAG}
- name: "Push Kagome Builder"
working-directory: ./housekeeping/docker/kagome-dev
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true'
run: make kagome_builder_push \
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH}
- name: "Login to Docker Hub"
uses: docker/login-action@v3
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: "Push Kagome Builder (DockerHub)"
working-directory: ./housekeeping/docker/kagome-dev
if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true'
run: make kagome_builder_push_dockerhub \
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH}
- name: "Versions Info"
if: always()
run: |
echo "Docker Image Name: ${{ steps.check-tag.outputs.kagome_builder }}"
build_kagome_runtime:
runs-on: [ actions-runner-controller ]
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name : "Authenticate with Google Cloud"
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: "Set up Cloud SDK"
uses: 'google-github-actions/setup-gcloud@v2'
- name: "Configure Docker for GCR"
run: |
gcloud auth configure-docker --quiet
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet
- name: "Build Runtime Cache"
working-directory: ./housekeeping/docker/kagome-dev
if: github.event.inputs.runtime_cache_rebuild == 'true'
run: make runtime_cache \
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \
TESTER_LATEST_TAG=${{ env.TESTER_LATEST_TAG }}
- name: "Push Runtime Cache"
working-directory: ./housekeeping/docker/kagome-dev
if: github.event.inputs.runtime_cache_rebuild == 'true'
run: make upload_apt_package_runtime \
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH}
- name: "Versions Info"
if: always()
working-directory: ./housekeeping/docker/kagome-dev
run: |
echo "Package name and version: kagome-dev-runtime $(python3 get_wasmedge_version.py)-$(date +'%y.%m.%d')"