From e8a1750d3882183f17d336a0af0dff97d8d0f291 Mon Sep 17 00:00:00 2001 From: yy Date: Wed, 9 Oct 2024 17:28:06 +0800 Subject: [PATCH 1/2] fix ci --- .github/workflows/cloud-release.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cloud-release.yml b/.github/workflows/cloud-release.yml index 5a8538be250..c4326acdf86 100644 --- a/.github/workflows/cloud-release.yml +++ b/.github/workflows/cloud-release.yml @@ -14,7 +14,6 @@ env: # Common versions GO_VERSION: "1.20" DEFAULT_OWNER: "labring" - TAG: ${{ github.event.inputs.tag || github.event.release.tag_name }} jobs: save-sealos: @@ -24,14 +23,14 @@ jobs: uses: ./.github/workflows/controllers.yml with: push_image: true - push_image_tag: ${{ env.TAG }} + push_image_tag: ${{ github.event.inputs.tag || github.event.release.tag_name }} secrets: inherit release-frontends: uses: ./.github/workflows/frontend.yml with: push_image: true - push_image_tag: ${{ env.TAG }} + push_image_tag: ${{ github.event.inputs.tag || github.event.release.tag_name }} secrets: inherit release-service: @@ -40,7 +39,7 @@ jobs: uses: ./.github/workflows/services.yml with: push_image: true - push_image_tag: ${{ env.TAG }} + push_image_tag: ${{ github.event.inputs.tag || github.event.release.tag_name }} secrets: inherit release-cloud: @@ -52,8 +51,8 @@ jobs: uses: ./.github/workflows/cloud.yml with: push_image: true - push_image_tag: ${{ env.TAG }} - build_from: ${{ env.TAG }} + push_image_tag: ${{ github.event.inputs.tag || github.event.release.tag_name }} + build_from: ${{ github.event.inputs.tag || github.event.release.tag_name }} secrets: inherit release-amd-offline-tar: @@ -75,8 +74,8 @@ jobs: sudo sealos version - name: Build run: | - export CLOUD_VERSION=${{ env.TAG }} - export VERSION=${{ env.TAG }} + export CLOUD_VERSION=${{ github.event.inputs.tag || github.event.release.tag_name }} + export VERSION=${{ github.event.inputs.tag || github.event.release.tag_name }} export ARCH=amd64 bash ./scripts/cloud/build-offline-tar.sh - name: Setup ossutil @@ -89,8 +88,8 @@ jobs: run: cat ./sealos-cloud.tar.gz.md5 - name: Upload run: | - ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ env.TAG }}-amd64.tar.gz - ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ env.TAG }}-amd64.tar.gz.md5 + ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.inputs.tag || github.event.release.tag_name }}-amd64.tar.gz + ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.inputs.tag || github.event.release.tag_name }}-amd64.tar.gz.md5 release-arm-offline-tar: needs: @@ -111,8 +110,8 @@ jobs: sudo sealos version - name: Build run: | - export CLOUD_VERSION=${{ env.TAG }} - export VERSION=${{ env.TAG }} + export CLOUD_VERSION=${{ github.event.inputs.tag || github.event.release.tag_name }} + export VERSION=${{ github.event.inputs.tag || github.event.release.tag_name }} export ARCH=arm64 bash ./scripts/cloud/build-offline-tar.sh - name: Setup ossutil @@ -125,5 +124,5 @@ jobs: run: cat ./sealos-cloud.tar.gz.md5 - name: Upload run: | - ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ env.TAG }}-arm64.tar.gz - ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ env.TAG }}-arm64.tar.gz.md5 + ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.inputs.tag || github.event.release.tag_name }}-arm64.tar.gz + ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.inputs.tag || github.event.release.tag_name }}-arm64.tar.gz.md5 From affc2ab0b1e99f09bcd700f40d5dea3bc14769c0 Mon Sep 17 00:00:00 2001 From: yy Date: Wed, 9 Oct 2024 17:34:36 +0800 Subject: [PATCH 2/2] add skip releases. --- .github/workflows/cloud-release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cloud-release.yml b/.github/workflows/cloud-release.yml index c4326acdf86..a6715e4f9e0 100644 --- a/.github/workflows/cloud-release.yml +++ b/.github/workflows/cloud-release.yml @@ -9,6 +9,11 @@ on: description: 'Tag for manual release' required: false default: '' + build_offline_tar_only: + description: 'Build offline tar only' + required: false + default: false + type: boolean env: # Common versions @@ -20,6 +25,7 @@ jobs: uses: ./.github/workflows/import-save-sealos.yml release-controllers: + if: ${{ github.event.inputs.build_offline_tar_only == false }} uses: ./.github/workflows/controllers.yml with: push_image: true @@ -27,6 +33,7 @@ jobs: secrets: inherit release-frontends: + if: ${{ github.event.inputs.build_offline_tar_only == false }} uses: ./.github/workflows/frontend.yml with: push_image: true @@ -34,6 +41,7 @@ jobs: secrets: inherit release-service: + if: ${{ github.event.inputs.build_offline_tar_only == false }} needs: - save-sealos uses: ./.github/workflows/services.yml @@ -43,6 +51,7 @@ jobs: secrets: inherit release-cloud: + if: ${{ github.event.inputs.build_offline_tar_only == false }} needs: - save-sealos - release-controllers