11#! /bin/bash
22
33#
4- # github-action-build.sh - A script to build and/or release SciJava-based projects
5- # automatically using GitHub Actions.
4+ # ci-build.sh - A script to build and/or release SciJava-based projects
5+ # automatically using a continuous integration
6+ # service.
67#
8+ # Required environment variables:
9+ # BUILD_OS - the operating system running the current build (e.g. macOS)
10+ # BUILD_REPOSITORY - the repository slug (org/repo) running the current build
711
812dir=" $( dirname " $0 " ) "
913
@@ -29,7 +33,7 @@ if [ -f pom.xml ]; then
2933 # Populate the settings.xml configuration.
3034 mkdir -p " $HOME /.m2"
3135 settingsFile=" $HOME /.m2/settings.xml"
32- customSettings=.github /settings.xml
36+ customSettings=.ci /settings.xml
3337 if [ -f " $customSettings " ]; then
3438 cp " $customSettings " " $settingsFile "
3539 else
8690 ciOrg=${ciPrefix##*/ }
8791 if [ ! " $SIGNING_ASC " ] || [ ! " $GPG_KEY_NAME " ] || [ ! " $GPG_PASSPHRASE " ] || [ ! " $MAVEN_PASS " ] || [ ! " $OSSRH_PASS " ]; then
8892 echo " No deploy -- secure environment variables not available"
89- elif [ " ${GITHUB_REPOSITORY} " != " $ciOrg /$ciRepo " ]; then
90- echo " No deploy -- repository fork: ${GITHUB_REPOSITORY} != $ciOrg /$ciRepo "
93+ elif [ " $BUILD_REPOSITORY " != " $ciOrg /$ciRepo " ]; then
94+ echo " No deploy -- repository fork: $BUILD_REPOSITORY != $ciOrg /$ciRepo "
9195 else
9296 echo " All checks passed for artifact deployment"
9397 deployOK=1
9498 fi
9599 fi
96100
97101 # Install GPG on OSX/macOS
98- if [ ${RUNNER_OS} = ' macOS' ]; then
102+ if [ $BUILD_OS = ' macOS' ]; then
99103 HOMEBREW_NO_AUTO_UPDATE=1 brew install gnupg2
100104 fi
101105
102106 # Import the GPG signing key.
103- keyFile=.github /signingkey.asc
107+ keyFile=.ci /signingkey.asc
104108 if [ " $deployOK " ]; then
105109 echo " == Importing GPG keypair =="
110+ mkdir -p .ci
106111 echo " $SIGNING_ASC " > " $keyFile "
107112 ls -la " $keyFile "
108113 gpg --batch --fast-import " $keyFile "
@@ -171,7 +176,7 @@ if [ -f environment.yml ]; then
171176
172177 echo
173178 echo " == Configuring environment =="
174- condaEnv=github -scijava
179+ condaEnv=ci -scijava
175180 test -d " $condaDir /envs/$condaEnv " && condaAction=update || condaAction=create
176181 conda env " $condaAction " -n " $condaEnv " -f environment.yml &&
177182 conda activate " $condaEnv "
0 commit comments