From d3d6e73f68fd49c303fda44b12eea3957ce0ef09 Mon Sep 17 00:00:00 2001 From: FalsePattern <30945458+FalsePattern@users.noreply.github.com> Date: Fri, 1 Jul 2022 19:22:58 +0200 Subject: [PATCH] update publishing --- .github/workflows/release-tags.yml | 8 ++++---- build.gradle | 19 +++++++------------ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 4ffdc90..0b1dd6b 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -11,9 +11,6 @@ on: jobs: build: runs-on: ubuntu-latest - env: - MAVEN_DEPLOY_USER: ${{ secrets.MAVEN_DEPLOY_USER }} - MAVEN_DEPLOY_PASSWORD: ${{ secrets.MAVEN_DEPLOY_PASSWORD }} steps: - uses: actions/checkout@v2 with: @@ -48,4 +45,7 @@ jobs: files: build/libs/*.jar - name: Publish to maven - run: ./gradlew publish \ No newline at end of file + run: ./gradlew publish + env: + MAVEN_DEPLOY_USER: ${{ secrets.MAVEN_DEPLOY_USER }} + MAVEN_DEPLOY_PASSWORD: ${{ secrets.MAVEN_DEPLOY_PASSWORD }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 4312faa..04bdec6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1656003793falsepattern25 +//version: 1656003793falsepattern26 /* DO NOT CHANGE THIS FILE! @@ -614,23 +614,18 @@ def getMavenSettingsCredentials = { } def getCredentials = { - try { + String username = System.getenv("MAVEN_DEPLOY_USER") + String password = System.getenv("MAVEN_DEPLOY_PASSWORD") + if (username == null || password == null) { def entries = getMavenSettingsCredentials() for (entry in entries) { if (entry."id".text() == repositoryName) { return [username: entry.username.text(), password: entry.password.text()] } } - throw new Exception(); - } catch (Exception ignored) { - //Try from environment variables if file does not exist - String username = System.getenv("MAVEN_DEPLOY_USER") - String password = System.getenv("MAVEN_DEPLOY_PASSWORD") - if (username == null || password == null) { - return [username: null, password: null] - } else { - return [username: username, password: password] - } + return [username: null, password: null] + } else { + return [username: username, password: password] } }