-
Notifications
You must be signed in to change notification settings - Fork 71
173 lines (147 loc) · 6.03 KB
/
release.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
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
---
name: release
on:
workflow_dispatch:
inputs:
release_tag:
description: 'release tag'
required: true
release_title:
description: 'release title'
required: false
release_notes:
description: 'release notes'
required: false
default: ''
jobs:
create_release:
name: create_release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
qemu-version: '6.0.0'
- name: Build go binary for pause
run : ./../../build/go-multiarch-build.sh "go build -o ./../../build/_output/pause-linux"
working-directory: custom/pause
- name: Build go binary for nsutil
run : ./../../build/go-multiarch-build.sh "go build -o ./../../build/_output/nsutil-linux"
working-directory: custom/nsutil
- name: Build shared libraries for nsutil amd64
run: gcc -shared -fPIC nsutil.c -o ./../../build/_output/nsutil_amd64.so
working-directory: custom/nsutil
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build arm64 Docker image
run: docker buildx build --platform linux/arm64 -t myapp-arm64 --load .
working-directory: custom/nsutil
- name: Extract compiled binary
run: docker create --name myapp-arm64-container myapp-arm64 && docker cp myapp-arm64-container:/app/nsutil.so ./../../build/_output/nsutil_arm64.so
working-directory: custom/nsutil
- name: Build go binary for promql-cli
run : |
cp custom/promql-cli/promql-linux-amd64 build/_output/
cp custom/promql-cli/promql-linux-arm64 build/_output/
- name: Build go binary for dns_interceptor
run : go build -o ./../../build/_output/dns_interceptor
working-directory: custom/dns_interceptor
- name: create release along with artifact
uses: ncipollo/release-action@v1
with:
artifacts: "build/_output/*"
body: "${{ github.event.inputs.release_notes }}"
token: ${{ secrets.GITHUB_TOKEN }}
name: "${{ github.event.inputs.release_title }}"
tag: ${{ github.event.inputs.release_tag }}
push:
runs-on: ubuntu-20.04
needs: create_release
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DNAME }}
password: ${{ secrets.DPASS }}
- name: Build and push experiment-alpine
uses: docker/build-push-action@v2
with:
push: true
file: custom/hardened-alpine/experiment/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: LITMUS_VERSION=${{ github.event.inputs.release_tag }}
tags: litmuschaos/experiment-alpine:${{ github.event.inputs.release_tag }},litmuschaos/experiment-alpine:latest
- name: Build and push infra-alpine
uses: docker/build-push-action@v2
with:
push: true
file: custom/hardened-alpine/infra/Dockerfile
platforms: linux/amd64,linux/arm64
tags: litmuschaos/infra-alpine:${{ github.event.inputs.release_tag }},litmuschaos/infra-alpine:latest
- name: Build and push k8s
uses: docker/build-push-action@v2
with:
push: true
file: custom/k8s/Dockerfile
context: custom/k8s
platforms: linux/amd64,linux/arm64
tags: litmuschaos/k8s:${{ github.event.inputs.release_tag }},litmuschaos/k8s:latest
- name: Build and push curl
uses: docker/build-push-action@v2
with:
push: true
file: custom/curl/Dockerfile
context: custom/curl
platforms: linux/amd64,linux/arm64
tags: litmuschaos/curl:${{ github.event.inputs.release_tag }},litmuschaos/curl:latest
- name: Build and push litmus-checker
uses: docker/build-push-action@v2
with:
push: true
file: custom/litmus-checker/Dockerfile
context: custom/litmus-checker
platforms: linux/amd64,linux/arm64
tags: litmuschaos/litmus-checker:${{ github.event.inputs.release_tag }},litmuschaos/litmus-checker:latest
- name: Build and push litmus-app-deployer
uses: docker/build-push-action@v2
with:
push: true
file: custom/workflow-helper/app-deployer/Dockerfile
context: custom/workflow-helper/app-deployer
platforms: linux/amd64,linux/arm64
tags: litmuschaos/litmus-app-deployer:${{ github.event.inputs.release_tag }},litmuschaos/litmus-app-deployer:latest
- name: Build and push litmus-git-app-checker
uses: docker/build-push-action@v2
with:
push: true
file: custom/workflow-helper/app-checker/Dockerfile
context: custom/workflow-helper/app-checker
platforms: linux/amd64,linux/arm64
tags: litmuschaos/litmus-git-app-checker:${{ github.event.inputs.release_tag }},litmuschaos/litmus-git-app-checker:latest
- name: Build and push mongo-utils
uses: docker/build-push-action@v2
with:
push: true
file: custom/mongo-utils/Dockerfile
context: custom/mongo-utils/
platforms: linux/amd64,linux/arm64
tags: litmuschaos/mongo-utils:${{ github.event.inputs.release_tag }},litmuschaos/mongo-utils:latest
- name: Build and push litmus-helm-agent
uses: docker/build-push-action@v2
with:
push: true
file: custom/litmus-helm-agent/Dockerfile
context: custom/litmus-helm-agent/
platforms: linux/amd64,linux/arm64
tags: litmuschaos/litmus-helm-agent:${{ github.event.inputs.release_tag }},litmuschaos/litmus-helm-agent:latest