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/03 08:44:58 UTC

[camel-k-runtime] branch main updated (e47becf3 -> 0dfa0c7d)

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

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


    from e47becf3 build(deps): bump groovy-version from 3.0.17 to 3.0.18
     new 149525a3 chore: join nightly tasks
     new 0dfa0c7d feat: create release task

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/actions/automatic-updates/action.yml     | 36 ++++++++++-
 .github/workflows/automatic-changelog-update.yml | 59 -----------------
 .github/workflows/ci-build-camel-main.yaml       | 81 ------------------------
 .github/workflows/generate-sbom-main.yml         | 55 ----------------
 .github/workflows/nightly-automatic-updates.yml  | 34 +++++++++-
 release.adoc                                     | 16 ++++-
 scripts/release-branch.sh                        | 79 +++++++++++++++++++++++
 7 files changed, 160 insertions(+), 200 deletions(-)
 delete mode 100644 .github/workflows/automatic-changelog-update.yml
 delete mode 100644 .github/workflows/ci-build-camel-main.yaml
 delete mode 100644 .github/workflows/generate-sbom-main.yml
 create mode 100755 scripts/release-branch.sh


[camel-k-runtime] 01/02: chore: join nightly tasks

Posted by pc...@apache.org.
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-runtime.git

commit 149525a37bd10134185dbc00101499d60c1180db
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Mon Jul 3 10:30:34 2023 +0200

    chore: join nightly tasks
---
 .github/actions/automatic-updates/action.yml     | 36 ++++++++++-
 .github/workflows/automatic-changelog-update.yml | 59 -----------------
 .github/workflows/ci-build-camel-main.yaml       | 81 ------------------------
 .github/workflows/generate-sbom-main.yml         | 55 ----------------
 .github/workflows/nightly-automatic-updates.yml  | 34 +++++++++-
 5 files changed, 67 insertions(+), 198 deletions(-)

diff --git a/.github/actions/automatic-updates/action.yml b/.github/actions/automatic-updates/action.yml
index b73edda0..fc6139ad 100644
--- a/.github/actions/automatic-updates/action.yml
+++ b/.github/actions/automatic-updates/action.yml
@@ -33,10 +33,42 @@ runs:
         CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
       run: |
         ./scripts/sync_cq.sh
-        git add -A && git commit -m 'feat: new Camel Quarkus version' && echo "refresh=1" >> $GITHUB_ENV || echo "No changes in the release"
+        git add -A && git commit -m 'feat: new Camel Quarkus version' && echo "sync=1" >> $GITHUB_ENV || echo "No changes in the release"
+
+    - name: Generate changelog
+      uses: ../.github/actions/changelog
+      with:
+        token: ${{ secrets.GITHUB_TOKEN }}
+        release_branch: ${{ inputs.branch-ref }}
+    - name: Commit changelog files
+      env:
+        CI_USER: "github-actions[bot]"
+        CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
+      run: |
+        git config --local user.email "$CI_EMAIL"
+        git config --local user.name "$CI_USER"
+        git add CHANGELOG.md && git commit -m 'chore: update changelog' && echo "changelog=1" >> $GITHUB_ENV || echo "No changes to CHANGELOG.md"
+
+    - name: Set up JDK
+      uses: actions/setup-java@v3
+      with:
+        distribution: 'temurin'
+        java-version: 11
+        cache: 'maven'
+    - name: Build Camel-k-runtime Project for generating SBOM
+      run: ./mvnw -V --no-transfer-progress clean install -DskipTests -Psbom
+    - name: Commit sbom files
+      env:
+        CI_USER: "github-actions[bot]"
+        CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
+      run: |
+        git config --local user.email "$CI_EMAIL"
+        git config --local user.name "$CI_USER"
+        git add camel-k-runtime-sbom && git commit -m 'chore: update SBOM' && echo "sbom=1" >> $GITHUB_ENV || echo "No changes to SBOM"
+
     - name: Push changes
       shell: bash
-      if: env.refresh == 1
+      if: env.sync == 1 || env.changelog == 1 || env.sbom == 1
       env:
         CI_USER: "github-actions[bot]"
         CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
diff --git a/.github/workflows/automatic-changelog-update.yml b/.github/workflows/automatic-changelog-update.yml
deleted file mode 100644
index 8a6526ec..00000000
--- a/.github/workflows/automatic-changelog-update.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# 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: Changelog
-
-on:
-  schedule:
-    # Run at 3 during the night
-    - cron:  '0 3 * * *'
-  workflow_dispatch:
-
-jobs:
-  generate_changelog:
-    runs-on: ubuntu-latest
-    name: Generate changelog for main branch
-    if: github.ref == 'refs/heads/main' && github.repository == 'apache/camel-k-runtime'
-    steps:
-      - name: "Checkout camel-k-runtime"
-        uses: actions/checkout@v3
-        with:
-          persist-credentials: false
-          submodules: recursive
-
-      - name: Generate changelog
-        uses: ./.github/actions/changelog
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}
-          release_branch: "main"
-      - name: Commit files
-        env:
-          CI_USER: "github-actions[bot]"
-          CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
-        run: |
-          git config --local user.email "$CI_EMAIL"
-          git config --local user.name "$CI_USER"
-          git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo "push=1" >> $GITHUB_ENV || echo "No changes to CHANGELOG.md"
-
-      - name: Push changes
-        if: env.push == 1
-        env:
-          CI_USER: "github-actions[bot]"
-          CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
-          CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        run: |
-          git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:main
diff --git a/.github/workflows/ci-build-camel-main.yaml b/.github/workflows/ci-build-camel-main.yaml
deleted file mode 100644
index f1744f73..00000000
--- a/.github/workflows/ci-build-camel-main.yaml
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# 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: Build (Camel Main)
-
-env:
-  MAVEN_OPTS: -Xmx3000m
-  MAVEN_ARGS: -V -ntp -nsu -Dhttp.keepAlive=false -e
-concurrency:
-  group: ${{ github.ref }}-${{ github.workflow }}
-  cancel-in-progress: true
-
-on:
-  push:
-    branches:
-      - camel-main
-    paths-ignore:
-      - '**.adoc'
-      - 'KEYS'
-      - 'LICENSE'
-      - 'NOTICE'
-      - 'Jenkinsfile'
-  pull_request:
-    branches:
-      - camel-main
-    paths-ignore:
-      - '**.adoc'
-      - 'KEYS'
-      - 'LICENSE'
-      - 'NOTICE'
-      - 'Jenkinsfile'
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    steps:
-    - uses: actions/checkout@v3
-      with:
-        persist-credentials: false
-    - name: Set up JDK ${{ matrix.java }}
-      uses: actions/setup-java@v3
-      with:
-        distribution: 'temurin'
-        java-version: ${{ matrix.java }}
-    - name: Cache Maven packages
-      uses: actions/cache@v3
-      with:
-        path: ~/.m2
-        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
-        restore-keys: ${{ runner.os }}-m2
-#  For the time being (Camel 3.10 + Camel Quarkus 2.0) we remain aligned to Camel 3.10
-#  because that's what Camel Quarkus depends on. After that, we can re-enable this.
-#  See: https://github.com/apache/camel-k-runtime/issues/669
-#    - name: Build camel (main)
-#      run: |
-#        git clone --depth 1 --branch main https://github.com/apache/camel.git \
-#          && cd camel \
-#          && echo "Current Camel commit:" $(git rev-parse HEAD) \
-#          && ./mvnw ${MAVEN_ARGS} clean install -Pfastinstall
-# We are currently building with Quarkus Snapshots from Apache repos, which is why this
-# this temporarily disabled
-#    - name: Build camel-quarkus (main)
-#      run: |
-#        git clone --depth 1 --branch main https://github.com/apache/camel-quarkus.git \
-#          && cd camel-quarkus \
-#          && echo "Current Camel Quarkus commit:" $(git rev-parse HEAD) \
-#          && ./mvnw ${MAVEN_ARGS} clean install -Dquickly
-    - name: Build camel-k-runtime
-      run: ./mvnw ${MAVEN_ARGS} -Dcheckstyle.failOnViolation=true -Psourcecheck clean verify
diff --git a/.github/workflows/generate-sbom-main.yml b/.github/workflows/generate-sbom-main.yml
deleted file mode 100644
index 37abfa00..00000000
--- a/.github/workflows/generate-sbom-main.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# 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: Generate Camel K Runtime SBOM
-
-on:
-  schedule:
-    # Every 24 hours
-  - cron: '30 17 * * 0'
-  workflow_dispatch:
-  
-jobs:
-  build:
-    name: Camel K Runtime SBOM Generation
-    if: github.repository == 'apache/camel-k-runtime'
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout Camel-k-runtime project
-        uses: actions/checkout@v3
-        with:
-          ref: main
-          persist-credentials: false
-          fetch-depth: 0
-      - name: Set up JDK
-        uses: actions/setup-java@v3
-        with:
-          distribution: 'temurin'
-          java-version: 11
-          cache: 'maven'
-      - name: Build Camel-k-runtime Project for generating SBOM
-        run: ./mvnw -V --no-transfer-progress clean install -DskipTests -Psbom
-      - name: Create Pull Request
-        uses: peter-evans/create-pull-request@v5.0.2
-        with:
-          base: main
-          token: ${{ secrets.GITHUB_TOKEN }}
-          branch: regen_bot_sbom
-          title: '[Github Actions] Periodic Sync Camel K Runtime SBOM'
-          body: |
-            Camel-K-runtime for SBOM Generation.
-            see https://github.com/apache/camel-k-runtime/blob/main/.github/workflows/generate-sbom-main.yml
diff --git a/.github/workflows/nightly-automatic-updates.yml b/.github/workflows/nightly-automatic-updates.yml
index 1798ea0e..f3f116c6 100644
--- a/.github/workflows/nightly-automatic-updates.yml
+++ b/.github/workflows/nightly-automatic-updates.yml
@@ -40,4 +40,36 @@ jobs:
         branch-ref: "main"
         secretGithubToken: ${{ secrets.GITHUB_TOKEN }}
 
-# TODO: enable the process on the release branches as soon as version 2 is released
+  release-1.17.x:
+    if: github.repository == 'apache/camel-k-runtime'
+    runs-on: ubuntu-20.04
+    name: Automatic updates on release-1.17.x branch
+    steps:
+    - name: "Checkout code"
+      uses: actions/checkout@v3
+      with:
+        ref: release-1.17.x
+        persist-credentials: false
+        submodules: recursive
+    - name: Automatic updates on release-1.17.x
+      uses: ./.github/actions/automatic-updates
+      with:
+        branch-ref: "release-1.17.x"
+        secretGithubToken: ${{ secrets.GITHUB_TOKEN }}
+
+  release-1.15.x:
+    if: github.repository == 'apache/camel-k-runtime'
+    runs-on: ubuntu-20.04
+    name: Automatic updates on release-1.15.x branch
+    steps:
+    - name: "Checkout code"
+      uses: actions/checkout@v3
+      with:
+        ref: release-1.15.x
+        persist-credentials: false
+        submodules: recursive
+    - name: Automatic updates on release-1.15.x
+      uses: ./.github/actions/automatic-updates
+      with:
+        branch-ref: "release-1.15.x"
+        secretGithubToken: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file


[camel-k-runtime] 02/02: feat: create release task

Posted by pc...@apache.org.
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-runtime.git

commit 0dfa0c7d22c982bbad59ffb51e483145fe22ac0e
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Mon Jul 3 10:31:25 2023 +0200

    feat: create release task
    
    Closes #1056
---
 release.adoc              | 16 ++++++++--
 scripts/release-branch.sh | 79 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 2 deletions(-)

diff --git a/release.adoc b/release.adoc
index 38a656bd..b55ddc3d 100644
--- a/release.adoc
+++ b/release.adoc
@@ -58,9 +58,21 @@ As you will be required to publish on Apache servers via Maven, you will need to
 
 == Release process
 
-As the process will do `git` operations, it is advisable that you clone the Camel K Runtime repository to some new location (ie /tmp/) in order to avoid to conflict with any other development in progress. Consider if you're about to release from `main` branch (generally a new major or minor version) or from a `release` branch (when you're about to release a patch version). In the latter case, you need to checkout to the proper release branch, ie `git checkout release-1.17.x`.
+As the process will do `git` operations, it is advisable that you clone the Camel K Runtime repository to some new location (ie /tmp/) in order to avoid to conflict with any other development in progress. If you're starting a major or a minor release version, you need to create the correspective `release-a.b.x` branch. It's highly advisable not to release directly from `main` branch.
 
-When you're in the project directory, you can start the release process.
+=== Create release branch from main branch
+
+We have a script that simplify this process. As we do not only want to create and push a new branch, we also need to provide the CI tasks required for all the supported releases.
+
+```
+./script/release-branch.sh
+```
+
+NOTE: you can run the script with `-d` option to dry run and evaluate the changes before pushing them to the repo.
+
+=== Start the release process
+
+You need to checkout to the proper release branch, ie `git checkout release-1.17.x`. You can start the release process.
 
 To prepare a release and check problems:
 ```
diff --git a/scripts/release-branch.sh b/scripts/release-branch.sh
new file mode 100755
index 00000000..3f5c097d
--- /dev/null
+++ b/scripts/release-branch.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+set -e
+
+display_usage() {
+
+cat <<EOF
+Create a new release branch, synchronizing all CI tasks and resources.
+
+Usage: ./script/release-branch.sh
+
+--help                    This help message
+-d                        Dry run, do not push to GIT repo
+
+Example: ./script/release-branch.sh
+EOF
+
+}
+
+DRYRUN="false"
+SEMVER="^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)(-SNAPSHOT)$"
+
+main() {
+  parse_args $@
+  location=$(dirname $0)
+
+  VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
+  if ! [[ $VERSION =~ $SEMVER ]]; then
+    echo "❗ POM version must match major.minor.patch(-SNAPSHOT) semantic version: $1"
+    exit 1
+  fi
+  VERSION_FULL="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}"
+  VERSION_MM="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
+
+  new_release_branch="release-$VERSION_MM.x"
+  # Create release branch
+  git checkout -b $new_release_branch
+
+  # Support nightly CI tasks
+  # pick the oldest release (we will replace it)
+  oldest_release_branch=$(yq '.jobs[] | key | select ( . !="main" )' $location/../.github/workflows/nightly-automatic-updates.yml | sort | head -1)
+  echo "Swapping GH actions tasks from $oldest_release_branch to $new_release_branch"
+
+  sed -i "s/$oldest_release_branch/$new_release_branch/g" $location/../.github/workflows/nightly-automatic-updates.yml
+
+  if [ $DRY_RUN == "true" ]
+  then
+    echo "❗ dry-run mode on, won't push any change!"
+  else
+    git add --all
+    git commit -m "chore: starting release branch for $new_release_branch" || true
+    git push
+    echo "🎉 Changes pushed correctly!"
+  fi
+}
+
+parse_args(){
+  while [ $# -gt 0 ]
+  do
+      arg="$1"
+      case $arg in
+        -h|--help)
+          display_usage
+          exit 0
+          ;;
+        -d)
+          DRYRUN="true"
+          ;;
+        *)
+          echo "❗ unknown argument: $1"
+          display_usage
+          exit 1
+          ;;
+      esac
+      shift
+  done
+}
+
+main $*