Skip to content

Commit 514c1b4

Browse files
committed
fix reading github variables
1 parent f472f97 commit 514c1b4

2 files changed

Lines changed: 8 additions & 21 deletions

File tree

.github/workflows/test_and_deploy.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
- name: Testing
2323
run: ./gradlew test --stacktrace
2424

25-
- name: Setup tmate session
26-
if: ${{ failure() }}
27-
uses: mxschmitt/action-tmate@v3
25+
# - name: Setup tmate session
26+
# if: ${{ failure() }}
27+
# uses: mxschmitt/action-tmate@v3
2828

2929
publish:
3030
needs: test # Only runs if 'test' succeeds
@@ -41,8 +41,8 @@ jobs:
4141
java-version: '21'
4242

4343
- name: Publishing
44-
run: ./gradlew publishAllPublicationsToGitLabRepository --stacktrace
44+
run: ./gradlew publishAllPublicationsToGitLabRepository --stacktrace -P "java-cbc.build.artifactory.token=${{ secrets.GITLAB_REGITRY_TOKEN }}" -P "java-cbc.build.artifactory.username=${{ vars.GITLAB_REGITRY_USER }}" -P "java-cbc.build.artifactory.url=${{ vars.GITLAB_REGITRY_MAVEN_URL }}"
4545

46-
- name: Setup tmate session
47-
if: ${{ failure() }}
48-
uses: mxschmitt/action-tmate@v3
46+
# - name: Setup tmate session
47+
# if: ${{ failure() }}
48+
# uses: mxschmitt/action-tmate@v3

build.gradle

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,7 @@ publishing {
6464
authentication {
6565
header(HttpHeaderAuthentication)
6666
}
67-
//Use user based token from ENV variables
68-
} else if (System.getenv("GITLAB_REGITRY_TOKEN") != null) {
69-
println("Using ENV based User Token auth for mavenPublish!")
70-
71-
url = System.getenv('GITLAB_REGISTRY_MAVEN_URL')
72-
credentials(PasswordCredentials) {
73-
username = System.getenv("GITLAB_REGISTRY_USER")
74-
password = System.getenv("GITLAB_REGITRY_TOKEN")
75-
}
76-
authentication {
77-
header(BasicAuthentication)
78-
}
79-
80-
//Use user based token from gradle.properties file
67+
//Use user based token from gradle.properties file
8168
} else {
8269
println("Using gradle.properties based User Token auth for mavenPublish!")
8370

0 commit comments

Comments
 (0)