Skip to content

Commit

Permalink
update release error (labring#3132)
Browse files Browse the repository at this point in the history
* refactor(main): fix release error

Signed-off-by: cuisongliu <[email protected]>

* refactor(main): fix release error

Signed-off-by: cuisongliu <[email protected]>

---------

Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu committed May 25, 2023
1 parent f010bc2 commit ac62c85
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 72 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/cloud.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
name: Build Cloud Cluster image

on:
workflow_call:
inputs:
release:
required: false
type: boolean
default: false
release:
types: [ published ]
workflow_dispatch:
inputs:
push_image:
description: 'Push images'
description: 'Push image'
required: false
type: boolean
default: false
release_tag:
description: 'Release images'
push_image_tag:
description: 'Push image tag'
default: 'dev'
required: false
type: string
Expand Down Expand Up @@ -44,7 +40,7 @@ jobs:
uses: ./.github/workflows/import-save-sealos.yml

build-cluster-image:
if: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
if: ${{ (github.event_name == 'release') ||(github.event_name == 'push') || (inputs.push_image == true) }}
needs:
- save-sealos
runs-on: ubuntu-latest
Expand All @@ -55,10 +51,18 @@ jobs:
fetch-depth: 0
- name: Expose git commit data
uses: rlespinasse/git-commit-data-action@v1
- name: Check if tag
id: check_tag
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "isTag=true" >> "$GITHUB_OUTPUT"
else
echo "isTag=false" >> "$GITHUB_OUTPUT"
fi
- name: Prepare
id: prepare
run: |
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ inputs.release }}" "${{ inputs.release_tag }}"
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ steps.check_tag.outputs.isTag }}" "${{ inputs.push_image_tag }}"
echo repo=ghcr.io/${{ github.repository_owner }}/sealos-cloud >> $GITHUB_OUTPUT
- name: Download sealos
uses: actions/download-artifact@v3
Expand Down
42 changes: 26 additions & 16 deletions .github/workflows/controllers.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
name: Build Controllers image

on:
workflow_call:
inputs:
release:
required: false
type: boolean
default: false
create:
tags:
workflow_dispatch:
inputs:
push_image:
description: "Push images"
description: "Push image"
required: false
type: boolean
default: false
release_tag:
description: "Release images"
push_image_tag:
description: "Push image tag"
default: "dev"
required: false
type: string
Expand Down Expand Up @@ -119,11 +115,18 @@ jobs:
- name: Expose git commit data
uses: rlespinasse/git-commit-data-action@v1

- name: Check if tag
id: check_tag
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "isTag=true" >> "$GITHUB_OUTPUT"
else
echo "isTag=false" >> "$GITHUB_OUTPUT"
fi
- name: Prepare
id: prepare
run: |
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ inputs.release }}" "${{ inputs.release_tag }}"
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ steps.check_tag.outputs.isTag }}" "${{ inputs.push_image_tag }}"
echo docker_repo=ghcr.io/${{ github.repository_owner }}/sealos-${{ matrix.module.name }}-controller >> $GITHUB_OUTPUT
- # Add support for more platforms with QEMU (optional)
Expand All @@ -137,7 +140,7 @@ jobs:

- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
if: ${{ (github.event_name == 'push') ||(github.event_name == 'create') || (inputs.push_image == true) }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -159,14 +162,14 @@ jobs:
context: ./controllers/${{ matrix.module.path }}
file: ./controllers/${{ matrix.module.path }}/Dockerfile
# Push if it's a push event or if push_image is true
push: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
push: ${{ (github.event_name == 'push')||(github.event_name == 'create') || (inputs.push_image == true) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
save-sealos:
uses: ./.github/workflows/import-save-sealos.yml
build-cluster-image:
if: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
if: ${{ (github.event_name == 'push') ||(github.event_name == 'create') || (inputs.push_image == true) }}
needs:
- image-build
- save-sealos
Expand All @@ -193,11 +196,18 @@ jobs:

- name: Expose git commit data
uses: rlespinasse/git-commit-data-action@v1

- name: Check if tag
id: check_tag
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "isTag=true" >> "$GITHUB_OUTPUT"
else
echo "isTag=false" >> "$GITHUB_OUTPUT"
fi
- name: Prepare
id: prepare
run: |
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ inputs.release }}" "${{ inputs.release_tag }}"
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
Expand Down
42 changes: 26 additions & 16 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
name: Build Frontend Image

on:
workflow_call:
inputs:
release:
required: false
type: boolean
default: false
create:
tags:
workflow_dispatch:
inputs:
push_image:
description: 'Push images'
description: 'Push image'
required: false
type: boolean
default: false
release_tag:
description: 'Release images'
push_image_tag:
description: 'Push image tag'
default: 'dev'
required: false
type: string
Expand Down Expand Up @@ -63,11 +59,18 @@ jobs:

- name: Expose git commit data
uses: rlespinasse/git-commit-data-action@v1

- name: Check if tag
id: check_tag
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "isTag=true" >> "$GITHUB_OUTPUT"
else
echo "isTag=false" >> "$GITHUB_OUTPUT"
fi
- name: Prepare
id: prepare
run: |
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ inputs.release }}" "${{ inputs.release_tag }}"
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ steps.check_tag.outputs.isTag }}" "${{ inputs.push_image_tag }}"
- name: Extract module name
id: module_name
run: |
Expand All @@ -92,7 +95,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Login to Github Container Hub
if: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
if: ${{ (github.event_name == 'push') ||(github.event_name == 'create') || (inputs.push_image == true) }}
uses: docker/login-action@v2
with:
registry: ghcr.io
Expand All @@ -105,13 +108,13 @@ jobs:
context: ./frontend/${{ matrix.module }}
file: ./frontend/${{ matrix.module }}/Dockerfile
# Push if it's a push event or if push_image is true
push: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
push: ${{ (github.event_name == 'push') ||(github.event_name == 'create') || (inputs.push_image == true) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
save-sealos:
uses: ./.github/workflows/import-save-sealos.yml
cluster-image-build:
if: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
if: ${{ (github.event_name == 'push') ||(github.event_name == 'create') || (inputs.push_image == true) }}
needs:
- image-build
- save-sealos
Expand Down Expand Up @@ -140,11 +143,18 @@ jobs:
- name: Expose git commit data
uses: rlespinasse/git-commit-data-action@v1

- name: Check if tag
id: check_tag
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "isTag=true" >> "$GITHUB_OUTPUT"
else
echo "isTag=false" >> "$GITHUB_OUTPUT"
fi
- name: Prepare
id: prepare
run: |
tag_name=$(bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ inputs.release }}" "${{ inputs.release_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-${{ env.MODULE_NAME }}-frontend >> $GITHUB_OUTPUT
echo old_docker_image=ghcr.io/labring/sealos-${{ env.MODULE_NAME }}-frontend:dev >> $GITHUB_OUTPUT
echo new_docker_repo=ghcr.io/${{ github.repository_owner }}/sealos-${{ env.MODULE_NAME }}-frontend >> $GITHUB_OUTPUT
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ on:
- "*"

jobs:
workflow-frontend:
uses: ./.github/workflows/frontend.yml
with:
release: true
workflow-services:
uses: ./.github/workflows/services.yml
with:
release: true
workflow-controllers:
uses: ./.github/workflows/controllers.yml
with:
release: true
goreleaser:
runs-on: ubuntu-20.04
steps:
Expand Down
42 changes: 26 additions & 16 deletions .github/workflows/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ name: Build Services image


on:
workflow_call:
inputs:
release:
required: false
type: boolean
default: false
create:
tags:
workflow_dispatch:
inputs:
push_image:
description: 'Push images'
description: 'Push image'
required: false
type: boolean
default: false
release_tag:
description: 'Release images'
push_image_tag:
description: 'Push image tag'
default: 'dev'
required: false
type: string
Expand Down Expand Up @@ -109,11 +105,18 @@ jobs:
- name: Expose git commit data
uses: rlespinasse/git-commit-data-action@v1

- name: Check if tag
id: check_tag
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "isTag=true" >> "$GITHUB_OUTPUT"
else
echo "isTag=false" >> "$GITHUB_OUTPUT"
fi
- name: Prepare
id: prepare
run: |
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ inputs.release }}" "${{ inputs.release_tag }}"
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ steps.check_tag.outputs.isTag }}" "${{ inputs.push_image_tag }}"
echo docker_repo=ghcr.io/${{ github.repository_owner }}/sealos-${{ matrix.module }}-service >> $GITHUB_OUTPUT
- # Add support for more platforms with QEMU (optional)
Expand All @@ -127,7 +130,7 @@ jobs:

- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
if: ${{ (github.event_name == 'push') ||(github.event_name == 'create') || (inputs.push_image == true) }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -150,15 +153,15 @@ jobs:
context: ./service/${{ matrix.module }}
file: ./service/${{ matrix.module }}/Dockerfile
# Push if it's a push event or if push_image is true
push: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
push: ${{ (github.event_name == 'push') ||(github.event_name == 'create') || (inputs.push_image == true) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64

save-sealos:
uses: ./.github/workflows/import-save-sealos.yml
build-cluster-image:
if: ${{ (github.event_name == 'push') || (inputs.push_image == true) || (inputs.release == true) }}
if: ${{ (github.event_name == 'push') ||(github.event_name == 'create') || (inputs.push_image == true) }}
needs:
- image-build
- save-sealos
Expand All @@ -174,11 +177,18 @@ jobs:

- name: Expose git commit data
uses: rlespinasse/git-commit-data-action@v1

- name: Check if tag
id: check_tag
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "isTag=true" >> "$GITHUB_OUTPUT"
else
echo "isTag=false" >> "$GITHUB_OUTPUT"
fi
- name: Prepare
id: prepare
run: |
bash ./scripts/resolve-tag-image.sh "${{ inputs.push_image }}" "${{ inputs.release }}" "${{ inputs.release_tag }}"
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 }}-service >> $GITHUB_OUTPUT
echo new_docker_repo=ghcr.io/${{ github.repository_owner }}/sealos-${{ matrix.module }}-service >> $GITHUB_OUTPUT
echo cluster_repo=ghcr.io/${{ github.repository_owner }}/sealos-cloud-${{ matrix.module }}-service >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It is warmly welcomed if you have interest to hack on sealos. First, we encourag

## Reporting security issues

Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of sealos, please do not discuss it in public and even do not open a public issue. Instead we encourage you to send us a private email to [admin@sealyun.com](mailto:admin@sealyun.com) to report this.
Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of sealos, please do not discuss it in public and even do not open a public issue. Instead we encourage you to send us a private email to [admin@sealos.io](mailto:admin@sealos.io) to report this.

## Reporting general issues

Expand Down

0 comments on commit ac62c85

Please sign in to comment.