1313
1414dir=" $( dirname " $0 " ) "
1515
16- gitactionDir =.github
17- gitactionConfigRoot =/workflows/.gitaction.yml
18- gitactionConfig= $gitactionDir$gitactionConfigRoot
19- gitactionPRConfig= $gitactionDir /workflows/.gitaction-pr.yml
20- gitactionSetupScript= $gitactionDir /setup.sh
21- gitactionBuildScript= $gitactionDir /build.sh
22- gitactionSettingsFile= $gitactionDir /settings.xml
23- gitactionNotifyScript= $gitactionDir /notify.sh
16+ ciDir =.github
17+ ciConfigRoot =/workflows/.gitaction.yml
18+ ciConfig= $ciDir$ciConfigRoot
19+ ciPRConfig= $ciDir /workflows/.gitaction-pr.yml
20+ ciSetupScript= $ciDir /setup.sh
21+ ciBuildScript= $ciDir /build.sh
22+ ciSettingsFile= $ciDir /settings.xml
23+ ciNotifyScript= $ciDir /notify.sh
2424credentialsDir=$HOME /.scijava/credentials
2525varsFile=$credentialsDir /vars
2626pomMinVersion=' 17.1.1'
@@ -116,12 +116,12 @@ process() {
116116
117117 # -- GitHub Action sanity checks --
118118
119- test -e " $gitactionDir " -a ! -d " $gitactionDir " && die " $gitactionDir is not a directory"
120- test -e " $gitactionConfig " -a ! -f " $gitactionConfig " && die " $gitactionConfig is not a regular file"
121- test -e " $gitactionPRConfig " -a ! -f " $gitactionPRConfig " && die " $gitactionPRConfig is not a regular file"
122- test -e " $gitactionConfig " && warn " $gitactionConfig already exists"
123- test -e " $gitactionBuildScript " && warn " $gitactionBuildScript already exists"
124- test -e " $gitactionSetupScript " && warn " $gitactionSetupScript already exists"
119+ test -e " $ciDir " -a ! -d " $ciDir " && die " $ciDir is not a directory"
120+ test -e " $ciConfig " -a ! -f " $ciConfig " && die " $ciConfig is not a regular file"
121+ test -e " $ciPRConfig " -a ! -f " $ciPRConfig " && die " $ciPRConfig is not a regular file"
122+ test -e " $ciConfig " && warn " $ciConfig already exists"
123+ test -e " $ciBuildScript " && warn " $ciBuildScript already exists"
124+ test -e " $ciSetupScript " && warn " $ciSetupScript already exists"
125125
126126 # -- Do things --
127127
@@ -159,9 +159,9 @@ jobs:
159159 java-version: '8'
160160 distribution: 'zulu'
161161 - name: Set up CI environment
162- run: ./$gitactionSetupScript
162+ run: ./$ciSetupScript
163163 - name: Build with Maven
164- run: ./$gitactionBuildScript
164+ run: ./$ciBuildScript
165165 env:
166166 GPG_KEY_NAME: \$ {{ secrets.GPG_KEY_NAME }}
167167 GPG_PASSPHRASE: \$ {{ secrets.GPG_PASSPHRASE }}
@@ -170,7 +170,7 @@ jobs:
170170 OSSRH_PASS: \$ {{ secrets.OSSRH_PASS }}
171171 SIGNING_ASC: \$ {{ secrets.SIGNING_ASC }}
172172EOL
173- update " $gitactionConfig "
173+ update " $ciConfig "
174174
175175 # Add/update the GitHun Actions PR configuration file.
176176 cat > " $tmpFile " << EOL
@@ -206,11 +206,11 @@ jobs:
206206 java-version: '8'
207207 distribution: 'zulu'
208208 - name: Set up CI environment
209- run: ./$gitactionSetupScript
209+ run: ./$ciSetupScript
210210 - name: Build with Maven
211- run: ./$gitactionBuildScript
211+ run: ./$ciBuildScript
212212EOL
213- update " $gitactionPRConfig "
213+ update " $ciPRConfig "
214214
215215 # Add/update the GitHub Action setup script.
216216 cat > " $tmpFile " << EOL
@@ -219,7 +219,7 @@ curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/master/gith
219219sh github-action-ci.sh
220220EOL
221221 chmod +x " $tmpFile "
222- update " $gitactionSetupScript " " add executable script $gitactionSetupScript " " true"
222+ update " $ciSetupScript " " add executable script $ciSetupScript " " true"
223223
224224 # Add/update the GitHub Action build script.
225225 cat > " $tmpFile " << EOL
@@ -228,18 +228,18 @@ curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/master/ci-b
228228sh ci-build.sh
229229EOL
230230 chmod +x " $tmpFile "
231- update " $gitactionBuildScript " " add executable script $gitactionBuildScript " " true"
231+ update " $ciBuildScript " " add executable script $ciBuildScript " " true"
232232
233233 # Remove obsolete GitHub-Actions-related files.
234- if [ -f " $gitactionSettingsFile " ]
234+ if [ -f " $ciSettingsFile " ]
235235 then
236- info " Removing obsolete $gitactionSettingsFile (github-action-build.sh generates it now)"
237- $EXEC git rm -f " $gitactionSettingsFile "
236+ info " Removing obsolete $ciSettingsFile (github-action-build.sh generates it now)"
237+ $EXEC git rm -f " $ciSettingsFile "
238238 fi
239- if [ -f " $gitactionNotifyScript " ]
239+ if [ -f " $ciNotifyScript " ]
240240 then
241- info " Removing obsolete $gitactionNotifyScript (ImageJ Jenkins is dead)"
242- $EXEC git rm -f " $gitactionNotifyScript "
241+ info " Removing obsolete $ciNotifyScript (ImageJ Jenkins is dead)"
242+ $EXEC git rm -f " $ciNotifyScript "
243243 fi
244244 $EXEC git diff-index --quiet HEAD -- || $EXEC git commit -m " ${msgPrefix} remove obsolete files"
245245
@@ -276,11 +276,11 @@ EOL
276276 if grep -q " travis-ci.*svg" README.md > /dev/null 2>&1
277277 then
278278 info " Updating README.md GitHub Action badge"
279- sed " s;travis-ci.*;$domain /$repoSlug /actions/$gitactionConfigRoot /badge.svg)](https://$domain /$repoSlug /actions$gitactionConfigRoot );g" README.md > " $tmpFile "
279+ sed " s;travis-ci.*;$domain /$repoSlug /actions/$ciConfigRoot /badge.svg)](https://$domain /$repoSlug /actions$ciConfigRoot );g" README.md > " $tmpFile "
280280 update README.md ' update README.md badge link'
281281 else
282282 info " Adding GitHub Action badge to README.md"
283- echo " [](https://$domain /$repoSlug /actions/$gitactionConfigRoot )" > " $tmpFile "
283+ echo " [](https://$domain /$repoSlug /actions/$ciConfigRoot )" > " $tmpFile "
284284 echo >> " $tmpFile "
285285 test -f README.md && cat README.md >> " $tmpFile "
286286 update README.md ' add README.md badge link'
0 commit comments