From c2b4bcddba6cd4a3925cc04954879f379c074769 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 22 Mar 2020 22:53:39 +0000 Subject: [PATCH] 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 bca3ace552b78d7b99a81f61984d6732cb3eb70a. --- .github/deploy.sh | 33 ----------------------- .github/workflows/sonatype-deploy.yml | 16 ++++++++++- src/main/java/net/kemitix/node/Nodes.java | 6 ++--- 3 files changed, 18 insertions(+), 37 deletions(-) delete mode 100644 .github/deploy.sh diff --git a/.github/deploy.sh b/.github/deploy.sh deleted file mode 100644 index 384f4b6..0000000 --- a/.github/deploy.sh +++ /dev/null @@ -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." diff --git a/.github/workflows/sonatype-deploy.yml b/.github/workflows/sonatype-deploy.yml index 192bf3c..63b14fe 100644 --- a/.github/workflows/sonatype-deploy.yml +++ b/.github/workflows/sonatype-deploy.yml @@ -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 }} diff --git a/src/main/java/net/kemitix/node/Nodes.java b/src/main/java/net/kemitix/node/Nodes.java index e25dca0..4532162 100644 --- a/src/main/java/net/kemitix/node/Nodes.java +++ b/src/main/java/net/kemitix/node/Nodes.java @@ -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 the type of the node's content * @return a representation of the tree */ - @SuppressWarnings("movevariableinsideif") public static String drawTree( final Node 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();