From d92ff1e127db590d5a1da0c0dc9d20f36e3ef3e7 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Thu, 12 Mar 2020 15:53:17 -0500 Subject: [PATCH] actions debugging --- .github/workflows/main.yml | 5 +++++ scripts/release-prepare.sh | 34 ---------------------------------- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7ef859e0..15df23693 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,11 @@ jobs: java-package: jdk architecture: x64 + - name: avoid release loop + run: scripts/avoid-release-loop.sh + env: + GIT_RELEASE_BOT_NAME: "nb-droid" + - name: capture tty run: | echo "::set-env name=TTY::"$(tty) diff --git a/scripts/release-prepare.sh b/scripts/release-prepare.sh index c5ead9c39..06d91e1ce 100755 --- a/scripts/release-prepare.sh +++ b/scripts/release-prepare.sh @@ -6,18 +6,6 @@ GIT_RELEASE_BOT_NAME=${GIT_RELEASE_BOT_NAME:?GIT_RELEASE_BOT_NAME must be provid GITHUB_SHA=${GITHUB_SHA:?GITHUB_SHA must be provided} GITHUB_REF=${GITHUB_REF:?GITHUB_REF must be provided} RELEASE_BRANCH_NAME=${RELEASE_BRANCH_NAME:?RELEASE_BRANCH_NAME must be provided} -#MAVEN_LOCAL_REPO_PATH=${MAVEN_LOCAL_REPO_PATH:?MAVEN_LOCAL_REPO_PATH must be provided} -#MAVEN_REPO_LOCAL=${MAVEN_REPO_LOCAL:?MAVEN_REPO_LOCAL must be provided} -#MAVEN_ARGS=${MAVEN_ARGS:?MAVEN_ARGS must be provided} - -# avoid the release loop by checking if the latest commit is a release commit -readonly local last_release_commit_hash=$(git log --pretty=format:"%H" -1) -echo "Last $GIT_RELEASE_BOT_NAME commit: ${last_release_commit_hash}" -echo "Current commit: ${GITHUB_SHA}" -if [[ "${last_release_commit_hash}" = "${GITHUB_SHA}" ]]; then - echo "Skipping for $GIT_RELEASE_BOT_NAME commit" - exit 0 -fi # Filter the branch to execute the release on readonly local branch=${GITHUB_REF##*/} @@ -33,28 +21,6 @@ git checkout ${GITHUB_REF##*/} echo "Git reset hard to ${GITHUB_SHA}" git reset --hard ${GITHUB_SHA} -## This script will do a release of the artifact according to http://maven.apache.org/maven-release/maven-release-plugin/ -#echo "Setup git user name to '$GIT_RELEASE_BOT_NAME'" -#git config --global user.name "$GIT_RELEASE_BOT_NAME"; -#echo "Setup git user email to '$GIT_RELEASE_BOT_EMAIL'" -#git config --global user.email "$GIT_RELEASE_BOT_EMAIL"; -# -## Setup GPG -#echo "Import the GPG key" -#export GPG_TTY=$(tty) -#echo "$GPG_KEY" | base64 -d > private.key -#gpg --batch --no-tty --import ./private.key -#chmod -R 777 ~/.gnupg/ -#ls -ahl ~/.gnupg/ -#rm ./private.key - -#echo "Override the java home as gitactions is seting up the JAVA_HOME env variable" -#JAVA_HOME="/usr/local/openjdk-11/" -# Setup maven local repo -#if [[ -n "$MAVEN_LOCAL_REPO_PATH" ]]; then -# MAVEN_REPO_LOCAL="-Dmaven.repo.local=$MAVEN_LOCAL_REPO_PATH" -#fi - # Do the release echo "Do mvn release:prepare..." #mvn $MAVEN_REPO_LOCAL --batch-mode --global-settings release.xml -Dusername=$GITHUB_ACCESS_TOKEN release:prepare