diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index d46dabd0..e51c1c63 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -4,12 +4,13 @@ on: push: branches: - master + - release-* tags: - 'v*' workflow_dispatch: {} jobs: - build-push-acr-and-ghcr-image: + build-push-image: runs-on: ubuntu-latest permissions: contents: read @@ -22,24 +23,24 @@ jobs: uses: docker/metadata-action@v4 with: images: | + oamdev/cluster-gateway ghcr.io/oam-dev/cluster-gateway - acr.kubevela.net/oamdev/cluster-gateway tags: | type=ref,event=branch type=ref,event=tag type=raw,value=latest,enable={{is_default_branch}} + - name: Login docker.io + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 + with: + registry: docker.io + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to ACR Registry - uses: docker/login-action@v2 - with: - registry: acr.kubevela.net - username: ${{ vars.ACR_USERNAME }} - password: ${{ secrets.ACR_PASSWORD }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 88a5245b..4d645f14 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ env: # Common versions GO_VERSION: '1.19' GOLANGCI_VERSION: 'v1.49' - KIND_VERSION: 'v0.17.0' + KIND_VERSION: 'v0.19.0' jobs: diff --git a/.github/workflows/go-postsubmit.yml b/.github/workflows/go-postsubmit.yml deleted file mode 100644 index 523252e4..00000000 --- a/.github/workflows/go-postsubmit.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: GoPostSubmit - -on: - push: - branches: - - master - - release-* - workflow_dispatch: {} - -env: - # Common versions - GO_VERSION: '1.19' - GO_REQUIRED_MIN_VERSION: '' - GOPATH: '/home/runner/work/oamdev/cluster-gateway/go' -defaults: - run: - working-directory: go/src/oamdev/cluster-gateway - -jobs: - image-multi-arch: - name: matrix-latest-images - runs-on: ubuntu-latest - strategy: - matrix: - arch: [ amd64, arm64 ] - steps: - - name: checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 1 - path: go/src/oamdev/cluster-gateway - - name: install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - name: image - run: | - IMG_TAG=latest-${{ matrix.arch }} \ - OS=linux \ - ARCH=${{ matrix.arch }} \ - make image - - name: Login docker.io - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 - with: - registry: docker.io - username: ${{ secrets.DOCKER_USER }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: push - run: | - docker push oamdev/cluster-gateway:latest-${{ matrix.arch }} - docker push oamdev/cluster-gateway-addon-manager:latest-${{ matrix.arch }} - image-manifest: - name: image manifest - runs-on: ubuntu-latest - needs: [ image-multi-arch ] - steps: - - name: checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 1 - path: go/src/oamdev/cluster-gateway - - name: Login docker.io - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 - with: - registry: docker.io - username: ${{ secrets.DOCKER_USER }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: create - run: | - docker manifest create oamdev/cluster-gateway:latest \ - oamdev/cluster-gateway:latest-amd64 \ - oamdev/cluster-gateway:latest-arm64 - docker manifest create oamdev/cluster-gateway-addon-manager:latest \ - oamdev/cluster-gateway-addon-manager:latest-amd64 \ - oamdev/cluster-gateway-addon-manager:latest-arm64 - - name: annotate - run: | - docker manifest annotate oamdev/cluster-gateway:latest \ - oamdev/cluster-gateway:latest-amd64 --arch amd64 - docker manifest annotate oamdev/cluster-gateway:latest \ - oamdev/cluster-gateway:latest-arm64 --arch arm64 - docker manifest annotate oamdev/cluster-gateway-addon-manager:latest \ - oamdev/cluster-gateway-addon-manager:latest-amd64 --arch amd64 - docker manifest annotate oamdev/cluster-gateway-addon-manager:latest \ - oamdev/cluster-gateway-addon-manager:latest-arm64 --arch arm64 - - name: push - run: | - docker manifest push oamdev/cluster-gateway:latest - docker manifest push oamdev/cluster-gateway-addon-manager:latest - diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index 65772706..33b4de62 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -3,7 +3,7 @@ name: GoRelease on: push: tags: - - 'v*.*.*' + - 'v*' env: # Common versions GO_VERSION: '1.19' @@ -74,16 +74,6 @@ jobs: run: | docker push oamdev/cluster-gateway:${{ needs.env.outputs.RELEASE_VERSION }}-${{ matrix.arch }} docker push oamdev/cluster-gateway-addon-manager:${{ needs.env.outputs.RELEASE_VERSION }}-${{ matrix.arch }} - - name: Login Alibaba Cloud ACR - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 - with: - registry: ${{ secrets.ACR_DOMAIN }} - username: ${{ secrets.ACR_USERNAME }} - password: ${{ secrets.ACR_PASSWORD }} - - name: push image multi arch to acr - run: | - docker tag oamdev/cluster-gateway:${{ needs.env.outputs.RELEASE_VERSION }}-${{ matrix.arch }} ${{ secrets.ACR_DOMAIN }}/oamdev/cluster-gateway:${{ needs.env.outputs.RELEASE_VERSION }}-${{ matrix.arch }} - docker push ${{ secrets.ACR_DOMAIN }}/oamdev/cluster-gateway:${{ needs.env.outputs.RELEASE_VERSION }}-${{ matrix.arch }} image-manifest: name: image-manifest runs-on: ubuntu-latest @@ -148,26 +138,27 @@ jobs: artifacts: "go/src/oamdev/cluster-gateway/release/*.tgz" token: ${{ secrets.GITHUB_TOKEN }} allowUpdates: true - - name: submit charts to OCM chart repo - uses: actions/github-script@v6 - with: - debug: ${{ secrets.ACTIONS_RUNNER_DEBUG }} - github-token: ${{ secrets.PAT_TOKEN }} - script: | - try { - const result = await github.rest.actions.createWorkflowDispatch({ - owner: 'open-cluster-management-io', - repo: 'helm-charts', - workflow_id: 'download-chart.yml', - ref: 'main', - inputs: { - repo: "${{ github.repository }}", - version: "${{ needs.env.outputs.TRIMED_RELEASE_VERSION }}", - "chart-name": "cluster-gateway-addon-manager", - }, - }) - console.log(result); - } catch(error) { - console.error(error); - core.setFailed(error); - } \ No newline at end of file +# lack secrets.PAT_TOKEN from ocm, commented now +# - name: submit charts to OCM chart repo +# uses: actions/github-script@v6 +# with: +# debug: ${{ secrets.ACTIONS_RUNNER_DEBUG }} +# github-token: ${{ secrets.PAT_TOKEN }} +# script: | +# try { +# const result = await github.rest.actions.createWorkflowDispatch({ +# owner: 'open-cluster-management-io', +# repo: 'helm-charts', +# workflow_id: 'download-chart.yml', +# ref: 'main', +# inputs: { +# repo: "${{ github.repository }}", +# version: "${{ needs.env.outputs.TRIMED_RELEASE_VERSION }}", +# "chart-name": "cluster-gateway-addon-manager", +# }, +# }) +# console.log(result); +# } catch(error) { +# console.error(error); +# core.setFailed(error); +# } \ No newline at end of file