From 74bc008d7455d511108506644870bcffab2461d5 Mon Sep 17 00:00:00 2001 From: Marek Kolodziejczak Date: Tue, 10 Sep 2024 18:13:29 +0200 Subject: [PATCH 1/4] add workflow for release build with image-builder --- .github/workflows/build-release.yaml | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build-release.yaml diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml new file mode 100644 index 0000000000..0c9d6c3fd8 --- /dev/null +++ b/.github/workflows/build-release.yaml @@ -0,0 +1,37 @@ +name: Release Build + +permissions: + id-token: write # This is required for requesting the JWT token + contents: read # This is required for actions/checkouts + +on: + push: + tags: + - '^\d+\.\d+\.\d+$' + - '^\d+\.\d+\.\d+-experimental$' + +jobs: + build-image: + name: Build manager image + if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-experimental') + uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main + with: + name: istio-manager + dockerfile: Dockerfile + context: . + build-args: | + VERSION=${{ github.ref_name }} + tags: "${{ github.ref_name }}" + + build-experimental-image: + name: Build experimental manager image + if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-experimental') + uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main + with: + name: istio-manager + dockerfile: Dockerfile + context: . + build-args: | + VERSION=${{ github.ref_name }}-experimental + GO_BUILD_TAGS=experimental + tags: "${{ github.ref_name }}-experimental" \ No newline at end of file From 4ccf47ac33274e71a1bfa7e483e1a4e38fecc23d Mon Sep 17 00:00:00 2001 From: Marek Kolodziejczak Date: Wed, 11 Sep 2024 11:43:30 +0200 Subject: [PATCH 2/4] move image building to create release workflow --- .github/workflows/create-release.yaml | 45 +++++++++++++-------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 623404e724..c93c4d3d0b 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -1,5 +1,9 @@ name: "Create release" +permissions: + id-token: write # This is required for requesting the JWT token + contents: read # This is required for actions/checkouts + on: workflow_dispatch: inputs: @@ -16,7 +20,6 @@ jobs: check-prerequisites: name: Check release prerequisites runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v4 @@ -44,7 +47,6 @@ jobs: name: Create draft release runs-on: ubuntu-latest needs: [check-prerequisites] - steps: - name: Checkout code uses: actions/checkout@v4 @@ -85,29 +87,26 @@ jobs: with: fetch-depth: 0 - - uses: autotelic/action-wait-for-status-check@6556cf50c8fb6608412945382eae73581f56cbb4 - name: Build image - id: wait-for-build + - name: Image build + uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main with: - token: ${{ secrets.GITHUB_TOKEN }} - statusName: "rel-istio-build" - intervalSeconds: "30" - timeoutSeconds: "1800" - - name: Check that module build status is success - if: steps.wait-for-build.outputs.state != 'success' - run: exit 1 - - - uses: autotelic/action-wait-for-status-check@6556cf50c8fb6608412945382eae73581f56cbb4 - name: Verify build of experimental image - id: wait-for-experimental-build + name: istio-manager + dockerfile: Dockerfile + context: . + build-args: | + VERSION=${{ github.event.inputs.name }} + tags: "${{ github.event.inputs.name }}" + + - name: Image build - experimental + uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main with: - token: ${{ secrets.GITHUB_TOKEN }} - statusName: "rel-istio-experimental-build" - intervalSeconds: "30" - timeoutSeconds: "300" - - name: Check that experimental module build status is success - if: steps.wait-for-experimental-build.outputs.state != 'success' - run: exit 1 + name: istio-manager + dockerfile: Dockerfile + context: . + build-args: | + VERSION=${{ github.event.inputs.name }}-experimental + GO_BUILD_TAGS=experimental + tags: "${{ github.event.inputs.name }}-experimental" - name: Publish release assets env: From 5ef24cd100475dc5ebf3d479b29003508f8e0c52 Mon Sep 17 00:00:00 2001 From: Marek Kolodziejczak Date: Wed, 11 Sep 2024 11:44:41 +0200 Subject: [PATCH 3/4] remove separate release image build workflow --- .github/workflows/build-release.yaml | 37 ---------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/build-release.yaml diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml deleted file mode 100644 index 0c9d6c3fd8..0000000000 --- a/.github/workflows/build-release.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Release Build - -permissions: - id-token: write # This is required for requesting the JWT token - contents: read # This is required for actions/checkouts - -on: - push: - tags: - - '^\d+\.\d+\.\d+$' - - '^\d+\.\d+\.\d+-experimental$' - -jobs: - build-image: - name: Build manager image - if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-experimental') - uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main - with: - name: istio-manager - dockerfile: Dockerfile - context: . - build-args: | - VERSION=${{ github.ref_name }} - tags: "${{ github.ref_name }}" - - build-experimental-image: - name: Build experimental manager image - if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-experimental') - uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main - with: - name: istio-manager - dockerfile: Dockerfile - context: . - build-args: | - VERSION=${{ github.ref_name }}-experimental - GO_BUILD_TAGS=experimental - tags: "${{ github.ref_name }}-experimental" \ No newline at end of file From 89ae5433d068bc17d0170e32f167a9cc235abc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ko=C5=82odziejczak?= <69915024+kolodziejczak@users.noreply.github.com> Date: Thu, 12 Sep 2024 08:42:53 +0200 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Tim Riffer --- .github/workflows/create-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index c93c4d3d0b..5e1bb812c8 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -87,7 +87,7 @@ jobs: with: fetch-depth: 0 - - name: Image build + - name: Build manager image uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main with: name: istio-manager @@ -97,7 +97,7 @@ jobs: VERSION=${{ github.event.inputs.name }} tags: "${{ github.event.inputs.name }}" - - name: Image build - experimental + - name: Build manager image - experimental uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main with: name: istio-manager