Skip to content

Commit c2f72e8

Browse files
committed
test publishing jars to github maven package repository
1 parent e11430d commit c2f72e8

File tree

9 files changed

+117
-109
lines changed

9 files changed

+117
-109
lines changed

.github/workflows/publish-container-image.yml

-62
This file was deleted.

.github/workflows/publish.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: 'temurin'
23+
java-version: 11
24+
25+
- name: Cache Maven Packages
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.m2
29+
key: ${{ runner.os }}-m2-${{ hashFiles('./**/pom.xml') }}
30+
restore-keys: ${{ runner.os }}-m2
31+
32+
- name: Publish Packages
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
CONTAINER_REGISTRY_USERNAME: ${GITHUB_ACTOR}
36+
CONTAINER_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
SMARTCLIDE_CONTEXT_GITLAB_API_TOKEN: ${{ secrets.GITLAB_DEV_SMARTCLIDE_EU_API_TOKEN }}
38+
run: mvn --file pom.xml --batch-mode deploy -Djib.to.auth.username="${CONTAINER_REGISTRY_USERNAME}" -Djib.to.auth.password="${CONTAINER_REGISTRY_TOKEN}"

.github/workflows/run-tests.yml

-33
This file was deleted.

.github/workflows/test.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
2+
3+
name: run-tests
4+
5+
on:
6+
push
7+
8+
jobs:
9+
test:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: 'temurin'
21+
java-version: 11
22+
23+
- name: Cache Maven Packages
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.m2
27+
key: ${{ runner.os }}-m2-${{ hashFiles('./**/pom.xml') }}
28+
restore-keys: ${{ runner.os }}-m2
29+
30+
- name: Run Tests
31+
env:
32+
SMARTCLIDE_CONTEXT_GITLAB_API_TOKEN: ${{ secrets.GITLAB_DEV_SMARTCLIDE_EU_API_TOKEN }}
33+
run: mvn --file pom.xml --batch-mode test

context-core/pom.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.eclipse.opensmartclide.context</groupId>
88
<artifactId>parent</artifactId>
9-
<version>2.0.0</version>
9+
<version>2.0.1-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>context-core</artifactId>
@@ -77,7 +77,7 @@
7777
<version>2.0.7</version>
7878
</dependency>
7979

80-
<!-- Apache CXF ! -->
80+
<!-- Apache CXF -->
8181
<dependency>
8282
<groupId>org.apache.cxf</groupId>
8383
<artifactId>cxf-rt-frontend-jaxws</artifactId>
@@ -100,23 +100,23 @@
100100
<artifactId>cxf-rt-transports-http-hc</artifactId>
101101
<version>${cxf.version}</version>
102102
</dependency>
103-
<!-- end Apache CXF ! -->
103+
<!-- end Apache CXF -->
104104

105-
<!-- SimpleXMLFramework ! -->
105+
<!-- SimpleXMLFramework -->
106106
<dependency>
107107
<groupId>org.simpleframework</groupId>
108108
<artifactId>simple-xml</artifactId>
109109
<version>2.7.1</version>
110110
</dependency>
111-
<!-- End SimpleXMLFramework ! -->
111+
<!-- End SimpleXMLFramework -->
112112

113-
<!-- JSON Support ! -->
113+
<!-- JSON Support -->
114114
<dependency>
115115
<groupId>com.google.code.gson</groupId>
116116
<artifactId>gson</artifactId>
117117
<version>2.11.0</version>
118118
</dependency>
119-
<!-- END_JSON Support ! -->
119+
<!-- END_JSON Support -->
120120

121121
<dependency>
122122
<groupId>org.projectlombok</groupId>

context-extraction/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.eclipse.opensmartclide.context</groupId>
88
<artifactId>parent</artifactId>
9-
<version>2.0.0</version>
9+
<version>2.0.1-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>context-extraction</artifactId>

context-monitoring/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.eclipse.opensmartclide.context</groupId>
88
<artifactId>parent</artifactId>
9-
<version>2.0.0</version>
9+
<version>2.0.1-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>context-monitoring</artifactId>

pom.xml

+16-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.eclipse.opensmartclide.context</groupId>
77
<artifactId>parent</artifactId>
8-
<version>2.0.0</version>
8+
<version>2.0.1-SNAPSHOT</version>
99

1010
<packaging>pom</packaging>
1111

@@ -20,6 +20,14 @@
2020
<url>https://www.atb-bremen.de</url>
2121
</organization>
2222

23+
<distributionManagement>
24+
<repository>
25+
<id>github</id>
26+
<name>GitHub Packages</name>
27+
<url>https://maven.pkg.github.com/eclipse-opensmartclide/smartclide-context</url>
28+
</repository>
29+
</distributionManagement>
30+
2331
<properties>
2432
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2533
<maven.version>3.5.4</maven.version>
@@ -80,7 +88,8 @@
8088
</extraExtensions>
8189

8290
<excludes>
83-
<!--do not add license header to json files because json standard does not allow comments-->
91+
<!--do not add license header to json files-->
92+
<!--because the json standard does not allow comments-->
8493
<exclude>**/*.json</exclude>
8594
</excludes>
8695

@@ -156,6 +165,11 @@
156165
<artifactId>maven-surefire-plugin</artifactId>
157166
<version>3.3.0</version>
158167
</plugin>
168+
<plugin>
169+
<groupId>org.apache.maven.plugins</groupId>
170+
<artifactId>maven-deploy-plugin</artifactId>
171+
<version>3.1.2</version>
172+
</plugin>
159173
</plugins>
160174
</pluginManagement>
161175

smartclide-monitoring/pom.xml

+21-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.eclipse.opensmartclide.context</groupId>
88
<artifactId>parent</artifactId>
9-
<version>2.0.0</version>
9+
<version>2.0.1-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>smartclide-monitoring</artifactId>
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>org.eclipse.opensmartclide.context</groupId>
2525
<artifactId>context-monitoring</artifactId>
26-
<version>2.0.0</version>
26+
<version>2.0.1-SNAPSHOT</version>
2727
</dependency>
2828

2929
<dependency>
@@ -35,16 +35,34 @@
3535

3636
<build>
3737
<plugins>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-deploy-plugin</artifactId>
41+
<configuration>
42+
<!--don't publish smartclide-specific module to maven package registry-->
43+
<skip>true</skip>
44+
</configuration>
45+
</plugin>
46+
3847
<plugin>
3948
<groupId>com.google.cloud.tools</groupId>
4049
<artifactId>jib-maven-plugin</artifactId>
4150
<version>${jib-maven-plugin.version}</version>
51+
<executions>
52+
<execution>
53+
<!--automatically build and push image during maven deploy phase-->
54+
<phase>deploy</phase>
55+
<goals>
56+
<goal>build</goal>
57+
</goals>
58+
</execution>
59+
</executions>
4260
<configuration>
4361
<from>
4462
<image>eclipse-temurin:11.0.17_8-jre-jammy</image>
4563
</from>
4664
<to>
47-
<image>ghcr.io/eclipse-opensmartclide/smartclide/${project.artifactId}:latest</image>
65+
<image>ghcr.io/eclipse-opensmartclide/smartclide/${project.artifactId}:${project.version}</image>
4866
</to>
4967
<container>
5068
<ports>

0 commit comments

Comments
 (0)