Post Release 0.8.0 (#63)

* Release 0.8.0

* Clean up Nodes.drawTree

* Move deploy.sh commands into sonatype-deploy.yml

* Revert "Release 0.8.0"

This reverts commit bca3ace552.
This commit is contained in:
Paul Campbell 2020-03-22 22:53:39 +00:00 committed by GitHub
parent c7f4723e5b
commit c2b4bcddba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 37 deletions

33
.github/deploy.sh vendored
View file

@ -1,33 +0,0 @@
#!/usr/bin/env bash
# Decrypts the signing key in .github/codesigning.asc.enc
# Imports that key
# Uses .github/settings.xml and the release profile to deploy
echo "deploy.sh: Starting..."
(
cd .github
echo "Retrieving GPG Private KEY"
gpg --quiet \
--batch \
--yes \
--decrypt \
--passphrase="${GPG_PASSPHRASE}" \
--output codesigning.asc \
codesigning.asc.gpg
echo "Loading signing key"
gpg --batch \
--fast-import codesigning.asc
)
echo "Releasing..."
mvn --settings .github/settings.xml \
-Dskip-Tests=true \
-P release \
-B \
deploy
echo "deploy.sh: Done."

View file

@ -16,7 +16,21 @@ jobs:
- name: Build with Maven
run: mvn -B install
- name: Nexus Repo Publish
run: sh .github/deploy.sh
run: |
gpg --quiet \
--batch \
--yes \
--decrypt \
--passphrase="${{ secrets.GPG_PASSPHRASE }}" \
--output codesigning.asc \
.github/codesigning.asc.gpg
gpg --batch \
--fast-import codesigning.asc
mvn --settings .github/settings.xml \
-Dskip-Tests=true \
-P release \
-B \
deploy
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

View file

@ -127,20 +127,20 @@ public final class Nodes {
/**
* Draw a representation of the tree.
*
* @param node the root node to draw
* @param depth current depth for recursion
* @param <T> the type of the node's content
* @return a representation of the tree
*/
@SuppressWarnings("movevariableinsideif")
public static <T> String drawTree(
final Node<T> node,
final int depth
) {
final StringBuilder sb = new StringBuilder();
final String unnamed = "(unnamed)";
if (node.isNamed()) {
sb.append(formatByDepth(node.getName(), depth));
} else if (!node.getChildren().isEmpty()) {
sb.append(formatByDepth(unnamed, depth));
sb.append(formatByDepth("(unnamed)", depth));
}
node.getChildren().forEach(c -> sb.append(drawTree(c, depth + 1)));
return sb.toString();