@@ -71,7 +71,7 @@ update() {
7171process () {
7272 cd " $1 "
7373
74- # -- GitHub Action sanity checks --
74+ # -- Git sanity checks --
7575
7676 repoSlug=$( xmllint --xpath ' //*[local-name()="project"]/*[local-name()="scm"]/*[local-name()="connection"]' pom.xml| sed ' s_.*github.com[:/]\(.*\)<.*_\1_' )
7777 test " $repoSlug " && info " Repository = $repoSlug " || die ' Could not determine GitHub repository slug'
@@ -95,16 +95,14 @@ process() {
9595 # -- POM sanity checks --
9696
9797 parent=$( xmllint --xpath ' //*[local-name()="project"]/*[local-name()="parent"]/*[local-name()="artifactId"]' pom.xml| sed ' s/[^>]*>//' | sed ' s/<.*//' )
98- echo $parent # #########################################
9998 if [ -z " $SKIP_PARENT_CHECK " ]
10099 then
101100 test " $parent " = " pom-scijava" ||
102101 die " Not pom-scijava parent: $parent . Run with -p flag to skip this check."
103102 fi
104103
105- # https://docs.github.com/en/actions/managing-workflow-runs/adding-a-workflow-status-badge
104+ # ######################## CHANGE POM.XML??? #########################
106105 domain=$( grep " travis-ci\.[a-z]*/$repoSlug " pom.xml 2> /dev/null | sed ' s/.*\(travis-ci\.[a-z]*\).*/\1/' )
107- echo $domain # #################################################
108106 test " $domain " &&
109107 info " Detected domain from pom.xml: $domain " ||
110108 die " No valid ciManagement section in pom.xml. Please add one, then try again."
@@ -191,17 +189,18 @@ EOL
191189 fi
192190
193191 # update the README
194- if grep -q " travis-ci\.[a-zA-Z0-9/_-]*\.svg" README.md > /dev/null 2>&1
192+ # https://docs.github.com/en/actions/managing-workflow-runs/adding-a-workflow-status-badge
193+ if grep -q " github\.com\/[a-zA-Z0-9/_-]*\/actions/workflow/main.yml/badge.svg" README.md > /dev/null 2>&1
195194 then
196- info " Updating README.md Travis badge"
197- sed " s|travis-ci\. [a-zA-Z0-9/_-]*|$domain /$repoSlug |g" README.md > " $tmpFile "
198- update README.md ' Travis : fix README.md badge link'
195+ info " Updating README.md GitHub Action badge"
196+ sed " s|github\.com\/ [a-zA-Z0-9/_-]*|$domain /$repoSlug |g" README.md > " $tmpFile "
197+ update README.md ' GitHub Action : fix README.md badge link'
199198 else
200- info " Adding Travis badge to README.md"
199+ info " Adding GitHub Action badge to README.md"
201200 echo " [](https://$domain /$repoSlug )" > " $tmpFile "
202201 echo >> " $tmpFile "
203202 test -f README.md && cat README.md >> " $tmpFile "
204- update README.md ' Travis : add badge to README.md'
203+ update README.md ' GitHub Action : add badge to README.md'
205204 fi
206205
207206 # encrypt key/value pairs in variables file
213212 ' #' * ) continue ;;
214213 esac
215214 info " Encrypting ${p%% =* } "
215+ # ######################## TODO #########################
216216 yes | $EXEC travis encrypt --$mode " $p " --add env.global --repo " $repoSlug "
217217 test $? -eq 0 || die " Failed to encrypt variable '$p '"
218218 done < " $varsFile "
@@ -228,15 +228,17 @@ EOL
228228 if [ -z " $EXEC " ]
229229 then
230230 rm -f " $signingKeyDestFile .enc"
231+ # ######################## TODO #########################
232+ # https://docs.github.com/en/github/authenticating-to-github/generating-a-new-gpg-key
231233 encryptOutput=$( travis encrypt-file --$mode " $signingKeySourceFile " " $signingKeyDestFile .enc" --repo " $repoSlug " )
232234 test $? -eq 0 || die " Failed to encrypt signing key."
233235 encryptResult=$( echo " $encryptOutput " | grep openssl)
234236 test " $encryptResult " || die " No openssl variables emitted."
235237 key=$( echo " $encryptResult " | cut -d' ' -f4)
236238 iv=$( echo " $encryptResult " | cut -d' ' -f6)
237- sed -i.bak " s/\(sh travis- build.sh\)/\1 $key $iv /" " $travisBuildScript "
238- rm -f " $travisBuildScript .bak"
239- git add " $travisBuildScript " " $signingKeyDestFile .enc"
239+ sed -i.bak " s/\(sh github-action- build.sh\)/\1 $key $iv /" " $gitactionBuildScript "
240+ rm -f " $gitactionBuildScript .bak"
241+ git add " $gitactionBuildScript " " $signingKeyDestFile .enc"
240242 git commit -m " GitHub Action: add encrypted GPG signing keypair"
241243 fi
242244 else
@@ -251,6 +253,7 @@ test -d "$credentialsDir" ||
251253 " Please contact a SciJava administrator to receive a copy of this content."
252254
253255# check prerequisites
256+ # ######################## TODO #########################
254257check git sed cut perl xmllint travis
255258
256259# parse arguments
0 commit comments