-
Notifications
You must be signed in to change notification settings - Fork 11
146 lines (141 loc) · 4.87 KB
/
autobuild-k8s-cri-o-part4.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
name: cri-o for k8s 1.26+
on:
workflow_dispatch:
inputs:
sealosPatch:
description: 'sealos patch image for development.'
required: true
default: ghcr.io/labring/sealos-patch:latest
issue_comment:
types:
- created
env:
part: 4
allBuild: false
registry: ${{ vars.D_REGISTRY_NAME }}
repo: ${{ vars.D_REGISTRY_REPOSITORY }}
sealosPatch: ${{ github.event.inputs.sealosPatch }}
criType: cri-o
jobs:
resolve-issue-sealoslatest:
if: startswith(github.event.comment.body, '/kube') || startswith(github.event.comment.body, '/cri-o') || startswith(github.event.comment.body, '/single_part4') || startswith(github.event.comment.body, '/single_cri-o_part4') || contains(github.event.inputs.sealosPatch, 'sealos')
runs-on: ubuntu-20.04
outputs:
sealoslatest: ${{ steps.set-sealoslatest.outputs.sealoslatest }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set sealos LatestVersion
id: set-sealoslatest
run: |
export commentbody="${{github.event.comment.body}}"
.github/scripts/versions/versions_sealos.sh
resolve-versions-arch:
runs-on: ubuntu-20.04
needs:
- resolve-issue-sealoslatest
env:
sealoslatest: ${{ needs.resolve-issue-sealoslatest.outputs.sealoslatest }}
outputs:
matrix: ${{ steps.set-versions.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Resolve Versions
id: set-versions
run: .github/scripts/versions/versions_arch.sh
resolve-versions:
runs-on: ubuntu-20.04
needs:
- resolve-issue-sealoslatest
env:
sealoslatest: ${{ needs.resolve-issue-sealoslatest.outputs.sealoslatest }}
outputs:
matrix: ${{ steps.set-versions.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Resolve Versions
id: set-versions
run: .github/scripts/versions/versions.sh
build-images:
name: building
needs:
- resolve-issue-sealoslatest
- resolve-versions-arch
runs-on: ubuntu-20.04
env:
sealoslatest: ${{ needs.resolve-issue-sealoslatest.outputs.sealoslatest }}
strategy:
matrix: ${{ fromJson(needs.resolve-versions-arch.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download tools and sealos
run: .github/scripts/download.sh
- name: Auto build image
env:
username: ${{ vars.D_REGISTRY_REPOSITORY }}
password: ${{ secrets.D_REGISTRY_TOKEN }}
arch: ${{ matrix.arch }}
kubeVersion: ${{ matrix.version }}
run: .github/scripts/kubernetes.sh
build_manifest:
needs:
- resolve-issue-sealoslatest
- resolve-versions
- build-images
name: manifest
env:
sealoslatest: ${{ needs.resolve-issue-sealoslatest.outputs.sealoslatest }}
strategy:
matrix: ${{ fromJson(needs.resolve-versions.outputs.matrix) }}
runs-on: ubuntu-20.04
permissions:
issues: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download tools and sealos
run: .github/scripts/download.sh
- name: Manifest Image
env:
username: ${{ vars.D_REGISTRY_REPOSITORY }}
password: ${{ secrets.D_REGISTRY_TOKEN }}
version: ${{ matrix.version }}-${{ env.sealoslatest }}
run: .github/scripts/manifest.sh
- name: Checkout Sealos
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: labring/sealos
ref: main
- name: Update Sealos README
run: |
sed -i "s@\./@https://github.com/labring/sealos/blob/main/@g" ./README.md
sed -i "s@(/docs@(https://github.com/labring/sealos/blob/main/docs@g" ./README.md
perl -i -pe 's{(https://github\.com/labring/sealos/blob/main)(.*?\.(png|jpg|jpeg|gif|webp|svg))}{https://raw.githubusercontent.com/labring/sealos/main$2}gi' ./README.md
- name: Update image description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ vars.D_REGISTRY_REPOSITORY }}
password: ${{ secrets.D_REGISTRY_TOKEN }}
repository: labring/kubernetes-crio
readme-filepath: ./README.md
enable-url-completion: true
add-tips:
if: contains(github.event.comment.body, 'imagebuild')
needs:
- build_manifest
name: Auto add tips
runs-on: ubuntu-20.04
permissions:
issues: write
steps:
- name: Success Commit
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: |
🤖 says: Hooray! The action autobuild-k8s-cri-o-part4 has been completed successfully. 🎉
See: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}