Merge pull request #102 from bmarwell/2.3-dist-rat-github-action

[BUILD] sign and rat-check on CI build
diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml
index e2b632e..a1b380c 100644
--- a/.github/workflows/ant.yml
+++ b/.github/workflows/ant.yml
@@ -55,10 +55,21 @@
           echo "mvnCommand=$(which mvn)" >> build.properties;
           echo "gpgCommand=$(which gpg)" >> build.properties;
 
+      - name: Create a gpg key for signing
+        shell: bash
+        run: >-
+          gpg --quick-gen-key --batch --passphrase '' github-build@apache.invalid;
+          echo "batch" >> "/home/runner/.gnupg/gpg.conf";
+          echo "pinentry-mode=loopback" >> "/home/runner/.gnupg/gpg.conf";
+
       - name: Prepare ant with ivy
         shell: bash
         run: ant download-ivy
 
       - name: Build with Ant and ivy
         shell: bash
-        run: ant ci
+        run: ant ci -Dci=true
+
+      - name: RAT check
+        shell: bash
+        run: ant rat
diff --git a/build.xml b/build.xml
index a7579b9..6c499af 100644
--- a/build.xml
+++ b/build.xml
@@ -25,6 +25,8 @@
   xmlns:bnd="http://www.aqute.biz/bnd"
   xmlns:rat="antlib:org.apache.rat.anttasks"
   xmlns:u="http://freemarker.org/util"
+  xmlns:if="ant:if"
+  xmlns:unless="ant:unless"
 >
 
   <!-- ================================================================== -->
@@ -748,11 +750,12 @@
       <input
          validargs="y,n"
          addproperty="signatureGood"
+         unless:set="ci"
       >Is the above signer the intended one for Apache releases?</input>
-      <condition property="signatureGood.y">
+      <condition property="signatureGood.y" unless:set="ci">
         <equals arg1="y" arg2="${signatureGood}"/>
       </condition>
-      <fail unless="signatureGood.y" message="Task aborted by user." />
+      <fail unless:set="ci" unless="signatureGood.y" message="Task aborted by user." />
 
       <echo>Creating checksum file for "${archive.gzip}"...</echo>
       <checksum file="${archive.gzip}" fileext=".sha512" algorithm="SHA-512" forceOverwrite="yes" />
@@ -952,7 +955,7 @@
   </target>
 
   <target name="ci"
-  	depends="ci-setup, clean, jar, test, javadoc"
+  	depends="ci-setup, clean, _dist"
   	description="CI should invoke this task"
   />