Skip to content

Commit b8b59d3

Browse files
authored
Merge pull request #77 from modelix/feature/fix-ghp-build
Improve maven publishing config and fix GitHub workflow
2 parents 49d0fdc + 87ba971 commit b8b59d3

File tree

2 files changed

+30
-35
lines changed

2 files changed

+30
-35
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Use tag as version
2828
run: echo "${GITHUB_REF#refs/*/}" > version.txt
2929
- name: Build and Publish Artifacts
30-
run: ./gradlew build publish -PciBuild=true -Partifacts.itemis.cloud.user=${{secrets.ARTIFACTS_ITEMIS_CLOUD_USER}} -Partifacts.itemis.cloud.pw=${{secrets.ARTIFACTS_ITEMIS_CLOUD_PW}} -PGITHUB_ACTOR=${{ github.actor }} -PGITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
30+
run: ./gradlew build publish -PciBuild=true -Partifacts.itemis.cloud.user=${{secrets.ARTIFACTS_ITEMIS_CLOUD_USER}} -Partifacts.itemis.cloud.pw=${{secrets.ARTIFACTS_ITEMIS_CLOUD_PW}} -Pgpr.user=${{ github.actor }} -Pgpr.key=${{ secrets.GITHUB_TOKEN }}
3131
env:
3232
NODE_AUTH_TOKEN: ${{ secrets.ARTIFACTS_ITEMIS_CLOUD_NPM_TOKEN }}
3333
- name: Set up QEMU

build.gradle.kts

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,37 @@ subprojects {
4444

4545
publishing {
4646
repositories {
47-
if (project.hasProperty("artifacts.itemis.cloud.user")) {
48-
maven {
49-
name = "itemis"
50-
url = if (version.toString().contains("SNAPSHOT"))
51-
uri("https://artifacts.itemis.cloud/repository/maven-mps-snapshots/")
52-
else
53-
uri("https://artifacts.itemis.cloud/repository/maven-mps-releases/")
54-
credentials {
55-
username = project.findProperty("artifacts.itemis.cloud.user").toString()
56-
password = project.findProperty("artifacts.itemis.cloud.pw").toString()
57-
}
47+
maven {
48+
name = "itemis"
49+
url = if (version.toString().contains("SNAPSHOT")) {
50+
uri("https://artifacts.itemis.cloud/repository/maven-mps-snapshots/")
51+
} else {
52+
uri("https://artifacts.itemis.cloud/repository/maven-mps-releases/")
53+
}
54+
credentials {
55+
username = project.findProperty("artifacts.itemis.cloud.user").toString()
56+
password = project.findProperty("artifacts.itemis.cloud.pw").toString()
5857
}
5958
}
60-
val ghp_username = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
61-
val ghp_password = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")
62-
if (ghp_username != null && ghp_password != null) {
63-
maven {
64-
name = "GitHubPackages"
65-
// we moved some components from modelix/modelix to modelix/modelix.core but github packages
66-
// cannot handle this situation. basically we suffer from what is described here:
67-
// https://github.com/orgs/community/discussions/23474
68-
// this is a simple workaround for the affected components.
69-
// consequently, when obtaining these dependencies, the repo url is the old modelix/modelix one...
70-
if (project.name in arrayOf("model-client",
71-
"model-client-js",
72-
"model-client-jvm",
73-
"model-server",
74-
"model-server-api")) {
75-
url = uri("https://maven.pkg.github.com/modelix/modelix")
76-
} else {
77-
url = uri("https://maven.pkg.github.com/modelix/modelix.core")
78-
}
79-
credentials {
80-
username = ghp_username
81-
password = ghp_password
82-
}
59+
maven {
60+
name = "GitHubPackages"
61+
// we moved some components from modelix/modelix to modelix/modelix.core but github packages
62+
// cannot handle this situation. basically we suffer from what is described here:
63+
// https://github.com/orgs/community/discussions/23474
64+
// this is a simple workaround for the affected components.
65+
// consequently, when obtaining these dependencies, the repo url is the old modelix/modelix one...
66+
if (project.name in arrayOf("model-client",
67+
"model-client-js",
68+
"model-client-jvm",
69+
"model-server",
70+
"model-server-api")) {
71+
url = uri("https://maven.pkg.github.com/modelix/modelix")
72+
} else {
73+
url = uri("https://maven.pkg.github.com/modelix/modelix.core")
74+
}
75+
credentials {
76+
username = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
77+
password = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")
8378
}
8479
}
8580
}

0 commit comments

Comments
 (0)