-
Notifications
You must be signed in to change notification settings - Fork 112
147 lines (121 loc) · 4.17 KB
/
release-production.yml
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
name: Release Production
on:
push:
tags: [v*]
jobs:
image:
strategy:
matrix:
module:
[
graphql,
grpc,
importer,
monitor,
rest,
rest-java,
rest-monitor,
rosetta,
test,
web3,
]
env:
CONTEXT: hedera-mirror-${{ matrix.module }}
IMAGE: gcr.io/mirrornode/hedera-mirror-${{ matrix.module }}
name: Publish images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get tag
run: echo "TAG=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Custom monitor path
if: matrix.module == 'rest-monitor'
run: echo "CONTEXT=hedera-mirror-rest/monitoring" >> $GITHUB_ENV
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 21
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: "${{ secrets.GCR_KEY }}"
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Configure Docker
run: gcloud auth configure-docker gcr.io,marketplace.gcr.io
- name: Build
uses: gradle/gradle-build-action@v2
if: matrix.module != 'rest' && matrix.module != 'rest-monitor' && matrix.module != 'rosetta'
with:
arguments: build -x test
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push images
uses: docker/build-push-action@v5
with:
build-args: VERSION=${{env.TAG}}
cache-from: type=gha
cache-to: type=gha,mode=max
context: ${{env.CONTEXT}}
platforms: linux/amd64, linux/arm64
provenance: false
push: true
tags: ${{env.IMAGE}}:${{env.TAG}},${{env.IMAGE}}:latest
chart:
name: Publish charts
needs: image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish helm chart
uses: stefanprodan/[email protected]
with:
target_dir: charts
token: ${{ secrets.GITHUB_TOKEN }}
marketplace:
name: GCP Marketplace release
needs: chart
if: "!contains(github.ref, '-')"
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
timeout-minutes: 15
env:
MPDEV: "/home/runner/mpdev"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
id: google-auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/798248771094/locations/global/workloadIdentityPools/default-pool/providers/gh-provider"
service_account: "[email protected]"
- name: Set GCloud CLI
uses: google-github-actions/setup-gcloud@v2
- name: Authorize Docker
run: gcloud auth configure-docker
- name: Install k3d
run: curl --retry 3 -fsL https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
- name: Create k3d cluster
run: k3d cluster create mirror --agents 1 --wait --image rancher/k3s:v1.28.5-k3s1
- name: Get tag
run: echo "TAG=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Install kubectl
run: curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
- name: Install mpdev
run:
docker run gcr.io/cloud-marketplace-tools/k8s/dev cat /scripts/dev > ${MPDEV}
&& chmod +x ${MPDEV}
- name: Install application
run: kubectl apply -f "https://raw.githubusercontent.com/GoogleCloudPlatform/marketplace-k8s-app-tools/master/crd/app-crd.yaml"
- name: Build images
run: ./release.sh "${TAG}"
working-directory: charts/marketplace/gcp
- name: Install marketplace app
run: ${MPDEV} verify --deployer=gcr.io/mirror-node-public/hedera-mirror-node/deployer:${TAG}