Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(main): add ci for latest #3512

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-patch-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "[DaylyReport] Auto build for sealos"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "[DaylyReport] Auto build for sealos"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "[DaylyReport] Auto build for sealos"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
Expand Down
43 changes: 31 additions & 12 deletions .github/workflows/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
default: false
push_image_tag:
description: "Push image tag"
default: "dev"
default: "latest"
required: false
type: string
push:
Expand Down Expand Up @@ -86,6 +86,7 @@ jobs:
- { name: db-adminer, path: db/adminer }
- { name: resources, path: resources }
- { name: resources-metering, path: resources/metering }
- { name: cloud, path: cloud }
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -154,7 +155,6 @@ jobs:
ghcr.io/${{ github.repository_owner }}/sealos-${{ matrix.module.name }}-controller
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=dev,enable=true
type=raw,value=${{ steps.prepare.outputs.tag_name }},enable=true

- name: build (and publish) ${{ matrix.module.name }} main image
Expand Down Expand Up @@ -190,6 +190,7 @@ jobs:
- { name: db-adminer, path: db/adminer }
- { name: resources, path: resources }
- { name: resources-metering, path: resources/metering }
- { name: cloud, path: cloud }
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -209,10 +210,12 @@ jobs:
- name: Prepare
id: prepare
run: |
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ steps.check_tag.outputs.isTag }}" "${{ inputs.push_image_tag }}"
tag_name=$(bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ steps.check_tag.outputs.isTag }}" "${{ inputs.push_image_tag }}")
echo old_docker_repo=ghcr.io/labring/sealos-${{ matrix.module.name }}-controller >> $GITHUB_OUTPUT
echo new_docker_repo=ghcr.io/${{ github.repository_owner }}/sealos-${{ matrix.module.name }}-controller >> $GITHUB_OUTPUT
echo cluster_repo=ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module.name }}-controller >> $GITHUB_OUTPUT
echo cluster_image=ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module.name }}-controller:${tag_name} >> $GITHUB_OUTPUT
echo latest_cluster_image=ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module.name }}-controller:latest >> $GITHUB_OUTPUT

- name: Download sealos
uses: actions/download-artifact@v3
Expand All @@ -227,7 +230,7 @@ jobs:
- name: Mutate image tag in deploy files
working-directory: controllers/${{ matrix.module.path }}/deploy
run: |
OLD_DOCKER_IMAGE_NAME=${{ steps.prepare.outputs.old_docker_repo }}:dev
OLD_DOCKER_IMAGE_NAME=${{ steps.prepare.outputs.old_docker_repo }}:latest
NEW_DOCKER_IMAGE_NAME=${{ steps.prepare.outputs.new_docker_repo }}:${{ steps.prepare.outputs.tag_name }}
sudo sed -i "s;${OLD_DOCKER_IMAGE_NAME};${NEW_DOCKER_IMAGE_NAME};" manifests/*

Expand All @@ -239,32 +242,48 @@ jobs:
- name: Build ${{ matrix.module.name }}-controller cluster image
working-directory: controllers/${{ matrix.module.path }}/deploy
run: |
CLUSTER_IMAGE_NAME=${{ steps.prepare.outputs.cluster_repo }}:${{ steps.prepare.outputs.tag_name }}
sudo sealos build -t ${CLUSTER_IMAGE_NAME}-amd64 --platform linux/amd64 -f Kubefile
sudo sealos build -t ${{ steps.prepare.outputs.cluster_image }}-amd64 --platform linux/amd64 -f Kubefile
sudo sealos build -t ${{ steps.prepare.outputs.latest_cluster_image }}-amd64 --platform linux/amd64 -f Kubefile
# delete old registry cache
sudo rm -rf registry
sudo sealos build -t ${CLUSTER_IMAGE_NAME}-arm64 --platform linux/arm64 -f Kubefile
sudo sealos build -t ${{ steps.prepare.outputs.cluster_image }}-arm64 --platform linux/arm64 -f Kubefile
sudo sealos build -t ${{ steps.prepare.outputs.latest_cluster_image }}-arm64 --platform linux/arm64 -f Kubefile

- name: Manifest Cluster Images
# if push to master, then patch images to ghcr.io
run: |
CLUSTER_IMAGE_NAME=${{ steps.prepare.outputs.cluster_repo }}:${{ steps.prepare.outputs.tag_name }}
sudo sealos images
bash docker/patch/manifest-cluster-images.sh $CLUSTER_IMAGE_NAME
bash docker/patch/manifest-cluster-images.sh ${{ steps.prepare.outputs.cluster_image }}
bash docker/patch/manifest-cluster-images.sh ${{ steps.prepare.outputs.latest_cluster_image }}
env:
OWNER: ${{ github.repository_owner }}

- name: Renew issue and Sync Images
- name: Renew issue and Sync Images for ${{ steps.prepare.outputs.cluster_image }}
uses: labring/gh-rebot@v0.0.6
if: ${{ github.repository_owner == env.DEFAULT_OWNER }}
with:
version: v0.0.8-rc1
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
SEALOS_ISSUE_REPO: "labring-actions/cluster-image"
SEALOS_COMMENT_BODY: "/imagesync ${{ steps.prepare.outputs.cluster_image }}"

- name: Renew issue and Sync Images for ${{ steps.prepare.outputs.latest_cluster_image }}
uses: labring/gh-rebot@v0.0.6
if: ${{ github.repository_owner == env.DEFAULT_OWNER }}
with:
version: v0.0.8-rc1
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "[DaylyReport] Auto build for sealos"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
SEALOS_ISSUE_REPO: "labring-actions/cluster-image"
SEALOS_COMMENT_BODY: "/imagesync ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module.name }}-controller:${{ steps.prepare.outputs.tag_name }}"
SEALOS_COMMENT_BODY: "/imagesync ${{ steps.prepare.outputs.latest_cluster_image }}"
33 changes: 25 additions & 8 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
default: false
push_image_tag:
description: "Push image tag"
default: "dev"
default: "latest"
required: false
type: string
push:
Expand Down Expand Up @@ -87,7 +87,6 @@ jobs:
ghcr.io/${{ github.repository_owner }}/sealos-${{ env.MODULE_NAME }}-frontend
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=dev,enable=true
type=raw,value=${{ steps.prepare.outputs.tag_name }},enable=true

- name: Set up QEMU
Expand Down Expand Up @@ -160,11 +159,12 @@ jobs:
run: |
tag_name=$(bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ steps.check_tag.outputs.isTag }}" "${{ inputs.push_image_tag }}")
echo old_docker_repo=ghcr.io/labring/sealos-${{ env.MODULE_NAME }}-frontend >> $GITHUB_OUTPUT
echo old_docker_image=ghcr.io/labring/sealos-${{ env.MODULE_NAME }}-frontend:dev >> $GITHUB_OUTPUT
echo old_docker_image=ghcr.io/labring/sealos-${{ env.MODULE_NAME }}-frontend:latest >> $GITHUB_OUTPUT
echo new_docker_repo=ghcr.io/${{ github.repository_owner }}/sealos-${{ env.MODULE_NAME }}-frontend >> $GITHUB_OUTPUT
echo new_docker_image=ghcr.io/${{ github.repository_owner }}/sealos-${{ env.MODULE_NAME }}-frontend:${tag_name} >> $GITHUB_OUTPUT
echo cluster_repo=ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ env.MODULE_NAME }}-frontend >> $GITHUB_OUTPUT
echo cluster_image=ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ env.MODULE_NAME }}-frontend:${tag_name} >> $GITHUB_OUTPUT
echo latest_cluster_image=ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ env.MODULE_NAME }}-frontend:latest >> $GITHUB_OUTPUT

- name: Download sealos
uses: actions/download-artifact@v3
Expand All @@ -186,29 +186,46 @@ jobs:
run: |
sudo sed -i "s;${{ steps.prepare.outputs.old_docker_image }};${{ steps.prepare.outputs.new_docker_image }};" manifests/*
sudo sealos build -t ${{ steps.prepare.outputs.cluster_image }}-amd64 --platform linux/amd64 -f Kubefile
sudo sealos build -t ${{ steps.prepare.outputs.latest_cluster_image }}-amd64 --platform linux/amd64 -f Kubefile
# delete old registry cache
sudo rm -rf registry
sudo sealos build -t ${{ steps.prepare.outputs.cluster_image }}-arm64 --platform linux/arm64 -f Kubefile
sudo sealos build -t ${{ steps.prepare.outputs.latest_cluster_image }}-arm64 --platform linux/arm64 -f Kubefile

- name: Manifest Cluster Images
run: |
CLUSTER_IMAGE_NAME=${{ steps.prepare.outputs.cluster_image }}
sudo sealos images
bash docker/patch/manifest-cluster-images.sh $CLUSTER_IMAGE_NAME
bash docker/patch/manifest-cluster-images.sh ${{ steps.prepare.outputs.cluster_image }}
bash docker/patch/manifest-cluster-images.sh ${{ steps.prepare.outputs.latest_cluster_image }}
env:
OWNER: ${{ github.repository_owner }}

- name: Renew issue and Sync Images
- name: Renew issue and Sync Images for ${{ steps.prepare.outputs.cluster_image }}
uses: labring/gh-rebot@v0.0.6
if: ${{ github.repository_owner == env.DEFAULT_OWNER }}
with:
version: v0.0.8-rc1
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "[DaylyReport] Auto build for sealos"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
SEALOS_ISSUE_REPO: "labring-actions/cluster-image"
SEALOS_COMMENT_BODY: "/imagesync ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ env.MODULE_NAME }}-frontend:${{ steps.prepare.outputs.tag_name }}"
SEALOS_COMMENT_BODY: "/imagesync ${{ steps.prepare.outputs.cluster_image }}"

- name: Renew issue and Sync Images for ${{ steps.prepare.outputs.latest_cluster_image }}
uses: labring/gh-rebot@v0.0.6
if: ${{ github.repository_owner == env.DEFAULT_OWNER }}
with:
version: v0.0.8-rc1
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
SEALOS_ISSUE_REPO: "labring-actions/cluster-image"
SEALOS_COMMENT_BODY: "/imagesync ${{ steps.prepare.outputs.latest_cluster_image }}"
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "[DaylyReport] Auto build for sealos"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
Expand All @@ -83,7 +83,7 @@ jobs:
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "[DaylyReport] Auto build for sealos"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,17 @@ jobs:
env:
OWNER: ${{ github.repository_owner }}

- name: Build ${{ matrix.module }}-service latest cluster image
working-directory: service/${{ matrix.module }}/deploy
run: |
CLUSTER_IMAGE_NAME_LATEST=${{ steps.prepare.outputs.cluster_repo }}:latest
sudo sealos build -t ${CLUSTER_IMAGE_NAME_LATEST}-amd64 --platform linux/amd64 -f Kubefile
sudo sealos build -t ${CLUSTER_IMAGE_NAME_LATEST}-arm64 --platform linux/arm64 -f Kubefile
sudo sealos images
bash docker/patch/manifest-cluster-images.sh $CLUSTER_IMAGE_NAME_LATEST
env:
OWNER: ${{ github.repository_owner }}

- name: Renew issue and Sync Images
uses: labring/gh-rebot@v0.0.6
if: ${{ github.repository_owner == env.DEFAULT_OWNER }}
Expand All @@ -240,9 +251,24 @@ jobs:
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "[DaylyReport] Auto build for sealos"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
SEALOS_ISSUE_REPO: "labring-actions/cluster-image"
SEALOS_COMMENT_BODY: "/imagesync ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module }}-service:${{ steps.prepare.outputs.tag_name }}"

- name: Renew issue and Sync Images for latest
uses: labring/gh-rebot@v0.0.6
if: ${{ github.repository_owner == env.DEFAULT_OWNER }}
with:
version: v0.0.8-rc1
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "issue_renew"
SEALOS_ISSUE_TITLE: "【DaylyReport】 Auto build for sealos"
SEALOS_ISSUE_BODYFILE: "scripts/ISSUE_RENEW.md"
SEALOS_ISSUE_LABEL: "dayly-report"
SEALOS_ISSUE_TYPE: "day"
SEALOS_ISSUE_REPO: "labring-actions/cluster-image"
SEALOS_COMMENT_BODY: "/imagesync ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module }}-service:latest"
Loading