File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ def repoUrlPrefix = "memphisos"
55
66node {
77 git credentialsId : ' main-github' , url : gitURL, branch : gitBranch
8+ def versionTag = readFile " ./version.conf"
89
910 try {
1011
@@ -19,6 +20,22 @@ node {
1920 sh " docker buildx use builder"
2021 sh " docker buildx build --push --tag ${ repoUrlPrefix} /${ imageName} --platform linux/amd64,linux/arm64 ."
2122 }
23+
24+ stage(' checkout to version branch' ){
25+ withCredentials([sshUserPrivateKey(keyFileVariable :' check' ,credentialsId : ' main-github' )]) {
26+ sh " git reset --hard origin/latest"
27+ sh " GIT_SSH_COMMAND='ssh -i $check ' git checkout -b ${ versionTag} "
28+ sh " GIT_SSH_COMMAND='ssh -i $check ' git push --set-upstream origin ${ versionTag} "
29+ }
30+ }
31+
32+ stage(' Create new release' ) {
33+ sh ' sudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo'
34+ sh ' sudo yum install gh -y'
35+ withCredentials([string(credentialsId : ' gh_token' , variable : ' GH_TOKEN' )]) {
36+ sh(script :""" gh release create \$ {versionTag} --generate-notes""" , returnStdout : true )
37+ }
38+ }
2239
2340 notifySuccessful()
2441
You can’t perform that action at this time.
0 commit comments