Skip to content

Commit 38160bd

Browse files
authored
Merge pull request #18 from EdwinBetanc0urt/bugfix/ci-token-credential
fix: CI/CD `deployRepository` gradle credential.
2 parents a82d9a2 + ae2631c commit 38160bd

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
env:
6262
ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.DEPLOY_USER }}
6363
ORG_GRADLE_PROJECT_deployToken: ${{ secrets.DEPLOY_TOKEN }}
64-
ORG_GRADLE_PROJECT_deplyRepository: ${{ secrets.DEPLOY_REPOSITORY }}
64+
ORG_GRADLE_PROJECT_deployRepository: ${{ secrets.DEPLOY_REPOSITORY }}
6565
GITHUB_DEPLOY_USER: ${{ github.actor }}
6666
GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
env:
4949
ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.DEPLOY_USER }}
5050
ORG_GRADLE_PROJECT_deployToken: ${{ secrets.DEPLOY_TOKEN }}
51-
ORG_GRADLE_PROJECT_deplyRepository: ${{ secrets.DEPLOY_REPOSITORY }}
51+
ORG_GRADLE_PROJECT_deployRepository: ${{ secrets.DEPLOY_REPOSITORY }}
5252
GITHUB_DEPLOY_USER: ${{ github.actor }}
5353
GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5454
GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }}

build.gradle

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ plugins {
22
id 'java'
33
id 'com.google.protobuf' version '0.9.4'
44
id 'idea'
5+
// Provide convenience executables for trying out the examples.
56
id 'application'
7+
// Generate Visual Studio Code .vscode & .json project files
68
id 'visual-studio'
9+
// Read .env files
710
id "io.github.uoxx3.project-environment" version "1.0.1"
811
}
912

10-
group 'com.nikhilm'
1113

12-
def grpcVersion = '1.62.2'
14+
def grpcVersion = '1.65.1'
1315
def protobufVersion = '3.25.3'
1416
def baseVersion = '3.9.4'
1517
def baseGroupId = 'io.github.adempiere'
@@ -46,11 +48,23 @@ jar {
4648
}
4749
}
4850

51+
run {
52+
doFirst {
53+
// Set environment variables by .env project file
54+
environment 'JWT_SECRET_KEY', '52D11677CBB494878FD6E93B5A6615052A93B8AC654DE543CC4F53BA56027B1C'
55+
environment 'JWT_EXPIRATION_TIME', 86400000
56+
environment "TZ", projectEnv.get("TZ", null) ?: "America/Caracas"
57+
}
58+
args = [
59+
"resources/env.yaml"
60+
]
61+
}
62+
4963
repositories {
5064
mavenLocal()
51-
mavenCentral()
52-
maven {
53-
// Adempiere GitHub Organization
65+
mavenCentral()
66+
maven {
67+
// Custom GitHub Repository (ADempiere by Default)
5468
url = findProperty("deployRepository") ?: System.properties['deploy.repository'] ?:
5569
projectEnv.get("GITHUB_DEPLOY_REPOSITORY", null) ?: System.getenv("GITHUB_DEPLOY_REPOSITORY") ?:
5670
"https://maven.pkg.github.com/adempiere/adempiere"
@@ -62,6 +76,17 @@ repositories {
6276
projectEnv.get("GITHUB_DEPLOY_TOKEN", null) ?: System.getenv("GITHUB_DEPLOY_TOKEN")
6377
}
6478
}
79+
maven {
80+
// Adempiere GitHub Organization
81+
url = 'https://maven.pkg.github.com/adempiere/adempiere'
82+
credentials {
83+
// project property, system property, .env project file, system enviroment variable
84+
username = findProperty("deployUsername") ?: System.properties['deploy.user'] ?:
85+
projectEnv.get("GITHUB_DEPLOY_USER", null) ?: System.getenv("GITHUB_DEPLOY_USER")
86+
password = findProperty("deployToken") ?: System.properties['deploy.token'] ?:
87+
projectEnv.get("GITHUB_DEPLOY_TOKEN", null) ?: System.getenv("GITHUB_DEPLOY_TOKEN")
88+
}
89+
}
6590
}
6691

6792
protobuf {
@@ -112,18 +137,6 @@ sourceSets {
112137
}
113138
}
114139

115-
run {
116-
doFirst {
117-
// Set environment variables
118-
environment 'JWT_SECRET_KEY', '52D11677CBB494878FD6E93B5A6615052A93B8AC654DE543CC4F53BA56027B1C'
119-
environment 'JWT_EXPIRATION_TIME', 86400000
120-
environment 'TZ', 'America/Caracas'
121-
}
122-
args = [
123-
"resources/env.yaml"
124-
]
125-
}
126-
127140
startScripts {
128141
applicationName = 'start-backend'
129142

0 commit comments

Comments
 (0)