You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/07/17 09:31:14 UTC

[camel-k] branch main updated: fix(ci): release staging from GH actions

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new fc3ee5f0b fix(ci): release staging from GH actions
fc3ee5f0b is described below

commit fc3ee5f0baf7851fe1d1f2ba4f7effbe8874e59c
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Mon Jul 17 11:31:04 2023 +0200

    fix(ci): release staging from GH actions
---
 .github/actions/release-staging/action.yml | 73 ++++++++++++++++++++++++++++++
 .github/workflows/staging-release.yml      | 52 +++++++++++++++++++++
 script/Makefile                            |  3 ++
 3 files changed, 128 insertions(+)

diff --git a/.github/actions/release-staging/action.yml b/.github/actions/release-staging/action.yml
new file mode 100644
index 000000000..69f0ff924
--- /dev/null
+++ b/.github/actions/release-staging/action.yml
@@ -0,0 +1,73 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+name: release-staging
+description: 'action used to release staging'
+
+inputs:
+  goVersion:
+    required: true
+    type: string
+  javaVersion:
+    required: true
+    type: string
+  # Make sure to treat the below values confidential (ie, not logging)
+  secretE2ECluster:
+    required: true
+  secretE2EKube:
+    required: true
+  secretDockerHubUser:
+    required: true
+  secretDockerHubPassword:
+    required: true
+  secretGithubToken:
+    required: true
+
+runs:
+  using: "composite"
+
+  steps:
+    - name: Install Go ${{ inputs.goVersion }}
+      uses: actions/setup-go@v4
+      with:
+        go-version: ${{ inputs.goVersion }}
+    - name: Install newer docker CLI supporting multi platform build
+      shell: bash
+      run: |
+        sudo apt-get update
+        sudo apt-get install ca-certificates curl gnupg
+        sudo install -m 0755 -d /etc/apt/keyrings
+        curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
+        sudo chmod a+r /etc/apt/keyrings/docker.gpg
+        echo \
+        "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
+        "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
+        sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+        sudo apt-get update
+        sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
+    - name: Set up QEMU (required by multi platform build)
+      uses: docker/setup-qemu-action@v2
+    - name: Login to Container Registry
+      uses: docker/login-action@v2
+      with:
+        username: ${{ inputs.secretDockerHubUser }}
+        password: ${{ inputs.secretDockerHubPassword }}
+    - name: Build and release staging containers
+      shell: bash
+      run: |
+        make images-all
+        make images-push-staging
diff --git a/.github/workflows/staging-release.yml b/.github/workflows/staging-release.yml
new file mode 100644
index 000000000..649ed5a75
--- /dev/null
+++ b/.github/workflows/staging-release.yml
@@ -0,0 +1,52 @@
+--- # ---------------------------------------------------------------------------
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+name: Staging release
+
+env:
+  TEST_CLUSTER: kind
+  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+  NEXUS_DEPLOY_USERNAME: ${{ secrets.NEXUS_USER }}
+  NEXUS_DEPLOY_PASSWORD: ${{ secrets.NEXUS_PW }}
+
+on:
+  workflow_dispatch:
+
+jobs:
+  release:
+
+    if: github.repository == 'apache/camel-k'
+    runs-on: ubuntu-latest
+    steps:
+    - name: "Checkout code"
+      uses: actions/checkout@v3
+      with:
+        ref: release-2.0.x
+        persist-credentials: false
+        submodules: recursive
+    - name: Release staging release-2.0.x branch
+      uses: ./.github/actions/release-staging
+      with:
+        goVersion: "1.18.x"
+        javaVersion: "17"
+        secretE2ECluster: ${{ secrets.E2E_CLUSTER_CONFIG }}
+        secretE2EKube: ${{ secrets.E2E_KUBE_CONFIG }}
+        secretDockerHubUser: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
+        secretDockerHubPassword: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
+        secretGithubToken: ${{ secrets.GITHUB_TOKEN }}
diff --git a/script/Makefile b/script/Makefile
index b2ec8e0d6..7404b51a4 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -454,6 +454,9 @@ endif
 image-push:
 	docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)
 
+images-all: images
+	make IMAGE_ARCH=arm64 images
+
 images-push:
 	docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)
 	docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64