diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 886381f..a504209 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -54,11 +54,7 @@ jobs: - name: Verify sealos run: | - wget -q https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz - tar -zxvf sealos_4.3.7_linux_amd64.tar.gz sealos - sudo chmod a+x sealos - sudo mv sealos /usr/bin/ - sudo sealos version + curl -sfL https://raw.githubusercontent.com/labring/sealos/v5.0.0/scripts/install.sh | sh -s v5.0.0 labring/sealos - name: build run: | go run gen/version/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info @@ -67,12 +63,13 @@ jobs: sudo sealos build -t "${IMAGE_NAME}"-amd64 --platform linux/amd64 . && sudo rm -rf registry sudo sealos build -t "${IMAGE_NAME}"-arm64 --platform linux/arm64 . && sudo rm -rf registry sudo sealos login -u ${{ github.repository_owner }} -p ${{ secrets.GH_TOKEN }} --debug ghcr.io - sudo sealos push "${IMAGE_NAME}"-amd64 - sudo sealos push "${IMAGE_NAME}"-arm64 - sudo sealos images - sudo sealos manifest create "${IMAGE_NAME}" - sudo sealos manifest add "$IMAGE_NAME" docker://"$IMAGE_NAME-amd64" - sudo sealos manifest add "$IMAGE_NAME" docker://"$IMAGE_NAME-arm64" - sudo sealos manifest push --all "$IMAGE_NAME" docker://"$IMAGE_NAME" && echo "$IMAGE_NAME push success" - sudo sealos images + bash manifest.sh ${IMAGE_NAME} + + sync: + runs-on: ubuntu-20.04 + needs: job1 + steps: + - name: build + run: | + gh issue comment ${{ vars.SEALOS_ISSUE_NUMBER }} --body "/imagebuild_apps automq-operator latest" --repo ${{ vars.SEALOS_ISSUE_REPO }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ca67c4..3b2a098 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,3 +80,42 @@ jobs: gh release upload "${{ github.ref }}" artifacts/* env: GH_TOKEN: ${{ secrets.GH_TOKEN }} + build-sealos: + name: build sealos images + runs-on: ubuntu-22.04 + needs: + - release + steps: + - name: Prepare + id: prepare + run: | + TAG=${GITHUB_REF#refs/tags/} + echo ::set-output name=tag_name::${TAG} + - uses: actions/checkout@v4 + - name: Verify sealos + run: | + curl -sfL https://raw.githubusercontent.com/labring/sealos/v5.0.0/scripts/install.sh | sh -s v5.0.0 labring/sealos + - name: build + run: | + wget -q https://github.com/cuisongliu/automq-operator/releases/download/${{ steps.prepare.outputs.tag_name }}/automq-operator-${{ steps.prepare.outputs.tag_name }}-sealos.tgz + mkdir -p automq-operator && tar -xzf automq-operator-${{ steps.prepare.outputs.tag_name }}-sealos.tgz -C automq-operator + cd automq-operator/deploy + IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/automq-operator-sealos:${{ steps.prepare.outputs.tag_name }}" + sudo sealos build -t "${IMAGE_NAME}"-amd64 --platform linux/amd64 . && sudo rm -rf registry + sudo sealos build -t "${IMAGE_NAME}"-arm64 --platform linux/arm64 . && sudo rm -rf registry + sudo sealos login -u ${{ github.repository_owner }} -p ${{ secrets.GH_TOKEN }} --debug ghcr.io + bash manifest.sh ${IMAGE_NAME} + sync-sealos-cluster-images: + name: sync sealos cluster images + runs-on: ubuntu-22.04 + needs: + - build-sealos + steps: + - name: Prepare + id: prepare + run: | + TAG=${GITHUB_REF#refs/tags/} + echo ::set-output name=tag_name::${TAG} + - name: build + run: | + gh issue comment ${{ vars.SEALOS_ISSUE_NUMBER }} --body "/imagebuild_apps automq-operator ${{ steps.prepare.outputs.tag_name }}" --repo ${{ vars.SEALOS_ISSUE_REPO }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d3aaf0..7380df2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,11 +36,7 @@ jobs: - name: Verify sealos run: | - wget -q https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz - tar -zxvf sealos_4.3.7_linux_amd64.tar.gz sealos - sudo chmod a+x sealos - sudo mv sealos /usr/bin/ - sudo sealos version + curl -sfL https://raw.githubusercontent.com/labring/sealos/v5.0.0/scripts/install.sh | sh -s v5.0.0 labring/sealos - name: prune os run: | sudo systemctl unmask containerd @@ -69,11 +65,7 @@ jobs: - name: Verify sealos run: | - wget -q https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz - tar -zxvf sealos_4.3.7_linux_amd64.tar.gz sealos - sudo chmod a+x sealos - sudo mv sealos /usr/bin/ - sudo sealos version + curl -sfL https://raw.githubusercontent.com/labring/sealos/v5.0.0/scripts/install.sh | sh -s v5.0.0 labring/sealos - name: build run: | go run gen/version/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info diff --git a/deploy/manifest.sh b/deploy/manifest.sh new file mode 100644 index 0000000..a773616 --- /dev/null +++ b/deploy/manifest.sh @@ -0,0 +1,10 @@ +#!/bin/bash +IMAGE_NAME=${1:-"ghcr.io/cuisongliu/automq-operator:latest"} +sudo sealos push "${IMAGE_NAME}"-amd64 +sudo sealos push "${IMAGE_NAME}"-arm64 +sudo sealos images +sudo sealos manifest create "${IMAGE_NAME}" +sudo sealos manifest add "$IMAGE_NAME" docker://"$IMAGE_NAME-amd64" +sudo sealos manifest add "$IMAGE_NAME" docker://"$IMAGE_NAME-arm64" +sudo sealos manifest push --all "$IMAGE_NAME" docker://"$IMAGE_NAME" && echo "$IMAGE_NAME push success" +sudo sealos images