From ae8a86780325f9bbdb4552ee291fdb239572f6e1 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Tue, 20 Jun 2023 21:23:37 +0800 Subject: [PATCH] build(main): auto renew issue and auto comment body (#3393) Signed-off-by: cuisongliu --- .github/workflows/ci-patch-image.yml | 38 ++++++++++++++++++---------- .github/workflows/cloud.yml | 19 +++++++++----- .github/workflows/controllers.yml | 19 +++++++++----- .github/workflows/frontend.yml | 19 +++++++++----- .github/workflows/release.yml | 20 ++++++++++----- .github/workflows/services.yml | 19 +++++++++----- scripts/ISSUE_RENEW.md | 4 +++ 7 files changed, 89 insertions(+), 49 deletions(-) create mode 100644 scripts/ISSUE_RENEW.md diff --git a/.github/workflows/ci-patch-image.yml b/.github/workflows/ci-patch-image.yml index 037ef33c7eb..e40570bace2 100755 --- a/.github/workflows/ci-patch-image.yml +++ b/.github/workflows/ci-patch-image.yml @@ -109,15 +109,20 @@ jobs: uses: actions/checkout@v3 - name: Expose git commit data uses: rlespinasse/git-commit-data-action@v1 - - name: Build sealos image - uses: peter-evans/create-or-update-comment@v1 + - name: Renew issue and Sync Images + uses: labring/gh-rebot@v0.0.6 if: ${{ github.repository_owner == env.DEFAULT_OWNER }} with: - issue-number: 359 - repository: labring-actions/cluster-image - body: | - /imagebuild_apps sealos ${{ env.GIT_COMMIT_SHORT_SHA }} - token: "${{ secrets.GH_PAT }}" + 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: "/imagebuild_apps sealos ${{ env.GIT_COMMIT_SHORT_SHA }}" save-sealos: uses: ./.github/workflows/import-save-sealos.yml build-on-cluster-patch-image: @@ -169,12 +174,17 @@ jobs: run: | TAG=dev echo tag_name=${GIT_COMMIT_SHORT_SHA} >> $GITHUB_OUTPUT - - name: Build sealos image - uses: peter-evans/create-or-update-comment@v1 + - name: Renew issue and Sync Images + uses: labring/gh-rebot@v0.0.6 if: ${{ github.repository_owner == env.DEFAULT_OWNER }} with: - issue-number: 359 - repository: labring-actions/cluster-image - body: | - /imagesync ghcr.io/${{ github.repository_owner }}/sealos-patch:${{ steps.prepare.outputs.tag_name }} - token: "${{ secrets.GH_PAT }}" + 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-patch:${{ steps.prepare.outputs.tag_name }}" diff --git a/.github/workflows/cloud.yml b/.github/workflows/cloud.yml index 8e54487d4f2..9b74f53c71a 100644 --- a/.github/workflows/cloud.yml +++ b/.github/workflows/cloud.yml @@ -91,12 +91,17 @@ jobs: # todo: build multi-arch images - - name: Sync Images - uses: peter-evans/create-or-update-comment@v1 + - name: Renew issue and Sync Images + uses: labring/gh-rebot@v0.0.6 if: ${{ github.repository_owner == env.DEFAULT_OWNER }} with: - issue-number: 359 - repository: labring-actions/cluster-image - body: | - /imagesync ghcr.io/${{ github.repository_owner }}/sealos-cloud:${{ steps.prepare.outputs.tag_name }} - token: "${{ secrets.GH_PAT }}" + 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:${{ steps.prepare.outputs.tag_name }}" diff --git a/.github/workflows/controllers.yml b/.github/workflows/controllers.yml index d578262c844..708c4431495 100644 --- a/.github/workflows/controllers.yml +++ b/.github/workflows/controllers.yml @@ -254,12 +254,17 @@ jobs: env: OWNER: ${{ github.repository_owner }} - - name: Sync Images - uses: peter-evans/create-or-update-comment@v1 + - name: Renew issue and Sync Images + uses: labring/gh-rebot@v0.0.6 if: ${{ github.repository_owner == env.DEFAULT_OWNER }} with: - issue-number: 359 - repository: labring-actions/cluster-image - body: | - /imagesync ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module.name }}-controller:${{ steps.prepare.outputs.tag_name }} - token: "${{ secrets.GH_PAT }}" + 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.name }}-controller:${{ steps.prepare.outputs.tag_name }}" diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index c7db27682e6..3851972baa5 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -198,12 +198,17 @@ jobs: env: OWNER: ${{ github.repository_owner }} - - name: Sync Images - uses: peter-evans/create-or-update-comment@v1 + - name: Renew issue and Sync Images + uses: labring/gh-rebot@v0.0.6 if: ${{ github.repository_owner == env.DEFAULT_OWNER }} with: - issue-number: 359 - repository: labring-actions/cluster-image - body: | - /imagesync ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ env.MODULE_NAME }}-frontend:${{ steps.prepare.outputs.tag_name }} - token: "${{ secrets.GH_PAT }}" + 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-${{ env.MODULE_NAME }}-frontend:${{ steps.prepare.outputs.tag_name }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c16f67e18f3..aa7572fb296 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,15 +60,21 @@ jobs: - name: Fetch Current version id: get-current-tag uses: actions-ecosystem/action-get-latest-tag@v1.6.0 - - name: Build sealos image + - name: Renew issue and Sync Images + uses: labring/gh-rebot@v0.0.6 if: ${{ github.repository_owner == env.DEFAULT_OWNER }} - uses: peter-evans/create-or-update-comment@v1 with: - issue-number: 359 - repository: labring-actions/cluster-image - body: | - /imagebuild_apps sealos ${{steps.get-current-tag.outputs.tag }} - token: "${{ secrets.GH_PAT }}" + 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: "/imagebuild_apps sealos ${{steps.get-current-tag.outputs.tag }}" + changelog: runs-on: ubuntu-20.04 needs: diff --git a/.github/workflows/services.yml b/.github/workflows/services.yml index ea9b6733193..67b0016b4f8 100644 --- a/.github/workflows/services.yml +++ b/.github/workflows/services.yml @@ -232,12 +232,17 @@ jobs: env: OWNER: ${{ github.repository_owner }} - - name: Sync Images - uses: peter-evans/create-or-update-comment@v1 + - name: Renew issue and Sync Images + uses: labring/gh-rebot@v0.0.6 if: ${{ github.repository_owner == env.DEFAULT_OWNER }} with: - issue-number: 359 - repository: labring-actions/cluster-image - body: | - /imagesync ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module }}-service:${{ steps.prepare.outputs.tag_name }} - token: "${{ secrets.GH_PAT }}" + 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:${{ steps.prepare.outputs.tag_name }}" diff --git a/scripts/ISSUE_RENEW.md b/scripts/ISSUE_RENEW.md new file mode 100644 index 00000000000..910b7c6ddd7 --- /dev/null +++ b/scripts/ISSUE_RENEW.md @@ -0,0 +1,4 @@ +## Sealos Image Update +``` +/imagesync imageSourceName +```