You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2020/07/14 08:59:26 UTC

[camel-k] branch master updated: Fix #1601: add v prefix to future tags

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

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


The following commit(s) were added to refs/heads/master by this push:
     new ad275d9  Fix #1601: add v prefix to future tags
ad275d9 is described below

commit ad275d95b4c16ade7fe4fdb470a9ca3da8ff6918
Author: Nicola Ferraro <ni...@gmail.com>
AuthorDate: Fri Jul 10 15:42:36 2020 +0200

    Fix #1601: add v prefix to future tags
---
 .github/workflows/release.yml                    |  5 +++--
 script/Makefile                                  | 11 +++++++----
 script/git_tag.sh                                | 16 +++++++++-------
 script/{git_tag.sh => set_go_modules_version.sh} | 19 +++++++++----------
 script/trigger_nightly_build.sh                  |  4 ++--
 5 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index bfb3000..6e6ee87 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -45,7 +45,7 @@ jobs:
           ${{ runner.os }}-go-
     - name: Prerequisites
       run: |
-        export OPERATOR_SDK_VERSION=v0.15.2
+        export OPERATOR_SDK_VERSION=v0.17.1
         curl -L https://github.com/operator-framework/operator-sdk/releases/download/v0.15.2/operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu -o operator-sdk
         chmod a+x operator-sdk
         sudo mv operator-sdk /usr/local/bin
@@ -55,7 +55,8 @@ jobs:
         TEST_DOCKER_HUB_USERNAME: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
         TEST_DOCKER_HUB_PASSWORD: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
       run: |
-        VERSION=${GITHUB_REF##*/}
+        TAG=${GITHUB_REF##*/}
+        VERSION=${TAG:1}
         echo "Using VERSION=$VERSION"
         echo "::set-env name=VERSION::$VERSION"
 
diff --git a/script/Makefile b/script/Makefile
index d56682d..91583d5 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -218,6 +218,9 @@ images-push-staging:
 set-version:
 	./script/set_version.sh $(VERSION) $(IMAGE_NAME)
 
+set-module-version:
+	./script/set_go_modules_version.sh $(VERSION)
+
 git-tag:
 	./script/git_tag.sh $(VERSION) $(RELEASE_GIT_REMOTE)
 
@@ -233,11 +236,11 @@ package-artifacts:
 unsnapshot-olm:
 	./script/unsnapshot_olm.sh
 
-release: clean codegen set-version build-resources check-licenses unsnapshot-olm build images images-push cross-compile package-examples git-tag
+release: clean codegen set-module-version set-version build-resources check-licenses unsnapshot-olm build images images-push cross-compile package-examples git-tag
 
-release-staging: clean codegen set-version build-resources check-licenses unsnapshot-olm build images images-push-staging cross-compile package-examples git-tag
+release-staging: clean codegen set-module-version set-version build-resources check-licenses unsnapshot-olm build images images-push-staging cross-compile package-examples git-tag
 
-release-nightly: clean codegen set-version build-resources build images images-push cross-compile package-examples
+release-nightly: clean codegen set-module-version set-version build-resources build images images-push cross-compile package-examples
 
 release-helm:
 	./script/release_helm.sh
@@ -258,4 +261,4 @@ get-staging-repo:
 get-version:
 	@echo $(VERSION)
 
-.PHONY: build build-kamel build-resources build-olm unsnapshot-olm dep codegen images images-dev images-push images-push-staging test check test-integration clean release cross-compile package-examples set-version git-tag release-notes check-licenses generate-deepcopy generate-client generate-doc build-resources release-helm release-staging release-nightly get-staging-repo get-version build-submodules
+.PHONY: build build-kamel build-resources build-olm unsnapshot-olm dep codegen images images-dev images-push images-push-staging test check test-integration clean release cross-compile package-examples set-version git-tag release-notes check-licenses generate-deepcopy generate-client generate-doc build-resources release-helm release-staging release-nightly get-staging-repo get-version build-submodules set-module-version
diff --git a/script/git_tag.sh b/script/git_tag.sh
index 121ad3a..b3ac3b8 100755
--- a/script/git_tag.sh
+++ b/script/git_tag.sh
@@ -18,19 +18,21 @@
 set -e
 
 if [ "$#" -ne 2 ]; then
-    echo "usage: $0 version branch"
+    echo "usage: $0 version remote"
     exit 1
 fi
 
 location=$(dirname $0)
 target_version=$1
-target_branch=$2
+target_tag=v$target_version
+target_staging=staging-$target_tag
+target_remote=$2
 
-git branch -D staging-${target_version} || true
-git checkout -b staging-${target_version}
+git branch -D ${target_staging} || true
+git checkout -b ${target_staging}
 git add * || true
 git commit -a -m "Release ${target_version}"
-git tag --force ${target_version} staging-${target_version}
-git push --force ${target_branch} ${target_version}
+git tag --force ${target_tag} ${target_staging}
+git push --force ${target_remote} ${target_tag}
 
-echo "Tag ${target_version} pushed ${target_branch}"
+echo "Tag ${target_tag} pushed ${target_remote}"
diff --git a/script/git_tag.sh b/script/set_go_modules_version.sh
similarity index 62%
copy from script/git_tag.sh
copy to script/set_go_modules_version.sh
index 121ad3a..663f6c6 100755
--- a/script/git_tag.sh
+++ b/script/set_go_modules_version.sh
@@ -17,20 +17,19 @@
 
 set -e
 
-if [ "$#" -ne 2 ]; then
-    echo "usage: $0 version branch"
+if [ "$#" -ne 1 ]; then
+    echo "usage: $0 version"
     exit 1
 fi
 
 location=$(dirname $0)
 target_version=$1
-target_branch=$2
+target_tag=v$target_version
 
-git branch -D staging-${target_version} || true
-git checkout -b staging-${target_version}
-git add * || true
-git commit -a -m "Release ${target_version}"
-git tag --force ${target_version} staging-${target_version}
-git push --force ${target_branch} ${target_version}
+api_rule="s/github.com\/apache\/camel-k\/pkg\/apis\/camel [A-Za-z0-9\.\-]+.*$/github.com\/apache\/camel-k\/pkg\/apis\/camel $target_tag/"
+client_rule="s/github.com\/apache\/camel-k\/pkg\/client\/camel [A-Za-z0-9\.\-]+.*$/github.com\/apache\/camel-k\/pkg\/client\/camel $target_tag/"
 
-echo "Tag ${target_version} pushed ${target_branch}"
+sed -i -r "$api_rule" $location/../go.mod
+sed -i -r "$client_rule" $location/../go.mod
+
+sed -i -r "$api_rule" $location/../pkg/client/camel/go.mod
diff --git a/script/trigger_nightly_build.sh b/script/trigger_nightly_build.sh
index 4f5ec9f..d157a34 100755
--- a/script/trigger_nightly_build.sh
+++ b/script/trigger_nightly_build.sh
@@ -16,5 +16,5 @@
 # limitations under the License.
 
 V=$(make get-version | sed s/-SNAPSHOT/-nightly.$(date +%Y%m%d%H%M)/)
-git tag $V
-git push upstream $V
+git tag v$V
+git push upstream v$V