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 2022/09/15 10:05:09 UTC

[camel-k] branch release-1.9.x updated: fix(ci): release nightly as an action

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

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


The following commit(s) were added to refs/heads/release-1.9.x by this push:
     new 5c7a07b25 fix(ci): release nightly as an action
5c7a07b25 is described below

commit 5c7a07b2522002004726ffa386483a0939554797
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Thu Sep 15 11:40:33 2022 +0200

    fix(ci): release nightly as an action
---
 .github/actions/release-nightly/action.yml | 120 +++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)

diff --git a/.github/actions/release-nightly/action.yml b/.github/actions/release-nightly/action.yml
new file mode 100644
index 000000000..2a3c60976
--- /dev/null
+++ b/.github/actions/release-nightly/action.yml
@@ -0,0 +1,120 @@
+# ---------------------------------------------------------------------------
+# 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-nightly
+description: 'action used to release nightly'
+
+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: Set up JDK ${{ inputs.javaVersion }}
+      uses: actions/setup-java@v2
+      with:
+        java-version: ${{ inputs.javaVersion }}
+        distribution: "temurin"
+    - name: Install Go ${{ inputs.goVersion }}
+      uses: actions/setup-go@v2
+      with:
+        go-version: ${{ inputs.goVersion }}
+    - name: Smoke tests
+      uses: ./.github/actions/e2e-common
+      with:
+        cluster-config-data: ${{ inputs.secretE2ECluster }}
+        cluster-kube-config-data: ${{ inputs.secretE2EKube }}
+    - name: Cache modules
+      uses: actions/cache@v1
+      with:
+        path: ~/go/pkg/mod
+        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
+        restore-keys: |
+          ${{ runner.os }}-go-
+    - name: Get nightly version and update date
+      shell: bash
+      run: |
+        V=$(make get-version | sed s/-SNAPSHOT/-nightly/)
+        D=$(date)
+        echo "VERSION=$V" >> $GITHUB_ENV
+        echo "UPD_DATE=$D" >> $GITHUB_ENV
+    - name: Global Env
+      shell: bash
+      run: |
+        echo "Using VERSION=${{ env.VERSION }}"
+
+        IMAGE_NAME=docker.io/${TEST_DOCKER_HUB_USERNAME:-testcamelk}/camel-k
+        echo "Using IMAGE_NAME=$IMAGE_NAME"
+        echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
+
+        MAVEN_REPOSITORY=$(make get-staging-repo)
+        echo "Using MAVEN_REPOSITORY=$MAVEN_REPOSITORY"
+        echo "MAVEN_REPOSITORY=$MAVEN_REPOSITORY" >> $GITHUB_ENV
+    - name: Login to Container Registry
+      uses: docker/login-action@v1
+      with:
+        username: ${{ inputs.secretDockerHubUser }}
+        password: ${{ inputs.secretDockerHubPassword }}
+    - name: Codegen
+      shell: bash
+      run: |
+        make VERSION=${{ env.VERSION }} IMAGE_NAME=${{ env.IMAGE_NAME }} codegen set-version build-resources
+    - name: Build
+      shell: bash
+      run: |
+        make VERSION=${{ env.VERSION }} IMAGE_NAME=${{ env.IMAGE_NAME }} release-nightly
+    - name: Check
+      shell: bash
+      run: ls -l
+    - name: Create Release
+      id: create_release
+      uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37
+      with:
+        artifacts: "./camel-k-client*.tar.gz"
+        body: |
+          Apache Camel K ${{ env.VERSION }} build for testing (unstable). This nightly release is using 
+          an **unsupported** operator image published as `${{ env.IMAGE_NAME }}:${{ env.VERSION }}`
+
+          To test it, download the client for your OS and run:
+
+          ```
+          kamel install --olm=false --maven-repository=${{ env.MAVEN_REPOSITORY }}
+          ```
+          
+          NOTE: last updated on ${{ env.UPD_DATE }}
+        token: ${{ inputs.secretGithubToken }}
+        draft: false
+        prerelease: true
+        allowUpdates: true
+        replacesArtifacts: true
+        tag: ${{ env.VERSION }}
+        commit: main