-
Notifications
You must be signed in to change notification settings - Fork 12
66 lines (63 loc) · 3.07 KB
/
autobuild-testsealos.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
name: Auto test for sealos rootfs
on:
workflow_dispatch:
jobs:
buildamd64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
wget https://github.com/labring/sealos/releases/download/v4.3.3/sealos_4.3.3_linux_amd64.tar.gz
tar -zxf sealos_4.3.3_linux_amd64.tar.gz sealos
chmod a+x sealos
./sealos version
cp -rf registry/* k3s/
ls k3s/etc/
ls k3s/scripts/
cd k3s && mkdir -p bin && wget https://github.com/k3s-io/k3s/releases/download/v1.27.4%2Bk3s1/k3s && chmod a+x k3s && mv k3s bin/k3s && cd ..
cd k3s && sed -i 's#v1.25.13#v1.25.13-amd64#g' Kubefile && cd ../
./sealos login -u ${{ vars.D_REGISTRY_REPOSITORY }} -p ${{ secrets.D_REGISTRY_TOKEN }} ${{ vars.D_REGISTRY_NAME }}
cd k3s && ../sealos build -t ${{ vars.D_REGISTRY_NAME }}/${{ vars.D_REGISTRY_REPOSITORY }}/k3s:latest-amd64 . && cd ../
./sealos images
./sealos push ${{ vars.D_REGISTRY_NAME }}/${{ vars.D_REGISTRY_REPOSITORY }}/k3s:latest-amd64
buildarm64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
wget https://github.com/labring/sealos/releases/download/v4.3.3/sealos_4.3.3_linux_amd64.tar.gz
tar -zxf sealos_4.3.3_linux_amd64.tar.gz sealos
chmod a+x sealos
./sealos version
cp -rf registry/* k3s/
ls k3s/etc/
ls k3s/scripts/
cd k3s && mkdir -p bin && wget https://github.com/k3s-io/k3s/releases/download/v1.27.4%2Bk3s1/k3s-arm64 && chmod a+x k3s-arm64 && mv k3s-arm64 bin/k3s && cd ..
cd k3s && sed -i 's#v1.25.13#v1.25.13-arm64#g' Kubefile && cd ../
./sealos login -u ${{ vars.D_REGISTRY_REPOSITORY }} -p ${{ secrets.D_REGISTRY_TOKEN }} ${{ vars.D_REGISTRY_NAME }}
cd k3s && ../sealos build --platform=linux/arm64/v8 -t ${{ vars.D_REGISTRY_NAME }}/${{ vars.D_REGISTRY_REPOSITORY }}/k3s:latest-arm64 . && cd ../
./sealos images
./sealos push ${{ vars.D_REGISTRY_NAME }}/${{ vars.D_REGISTRY_REPOSITORY }}/k3s:latest-arm64
build_manifest:
needs:
- buildamd64
- buildarm64
name: manifest
runs-on: ubuntu-20.04
steps:
- name: Build
run: |
wget https://github.com/labring/sealos/releases/download/v4.3.3/sealos_4.3.3_linux_amd64.tar.gz
tar -zxf sealos_4.3.3_linux_amd64.tar.gz sealos
chmod a+x sealos
./sealos version
IMAGE_NAME=${{ vars.D_REGISTRY_NAME }}/${{ vars.D_REGISTRY_REPOSITORY }}/k3s:latest
./sealos manifest create "${IMAGE_NAME}"
./sealos manifest add "$IMAGE_NAME" docker://"$IMAGE_NAME-amd64"
./sealos manifest add "$IMAGE_NAME" docker://"$IMAGE_NAME-arm64"
./sealos login -u ${{ vars.D_REGISTRY_REPOSITORY }} -p ${{ secrets.D_REGISTRY_TOKEN }} ${{ vars.D_REGISTRY_NAME }}
./sealos manifest push --all "$IMAGE_NAME" docker://"$IMAGE_NAME" && echo "$IMAGE_NAME push success"