Skip to content

Commit a06f884

Browse files
authored
Build with GitHub actions (#2)
Build cdoc2-java-ref-impl with GitHub Actions * Update Maven remoteRepository to https://maven.pkg.github.com/open-eid/cdoc2-capsule-server in pom.xml
1 parent 1cc8a14 commit a06f884

File tree

3 files changed

+80
-41
lines changed

3 files changed

+80
-41
lines changed

.github/workflows/maven.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,42 @@ jobs:
2323
runs-on: ubuntu-latest
2424

2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
- name: Set up JDK 17
28-
uses: actions/setup-java@v3
28+
uses: actions/setup-java@v4
2929

3030
with:
3131
java-version: '17'
3232
distribution: 'temurin'
33+
overwrite-settings: true #generate settings.xml
3334
cache: maven
34-
- name: Debug settings.xml
35-
run: |
36-
echo $(cat ~/.m2/settings.xml)
37-
echo $env.GITHUB_ACTOR
35+
36+
# - name: 'Create settings.xml with maven-settings-xml-action'
37+
# uses: whelk-io/maven-settings-xml-action@v22
38+
# with:
39+
# servers: >
40+
# [
41+
# {
42+
# "id": "github",
43+
# "username": "${{ env.GITHUB_ACTOR }}",
44+
# "password": "${{ env.GITHUB_TOKEN }}"
45+
# }
46+
# ]
47+
# env:
48+
# GITHUB_TOKEN: ${{ github.token }}
49+
3850

3951
- name: Build with Maven
4052
run: mvn -B package --file pom.xml
4153
env:
4254
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
4355

56+
- name: Debug settings.xml
57+
run: |
58+
echo $(cat ~/.m2/settings.xml)
59+
echo "GITHUB_ACTOR=${{ env.GITHUB_ACTOR }}"
60+
61+
4462
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
4563
#- name: Update dependency graph
4664
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

cdoc2-client/pom.xml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,11 @@
1818
<jackson-databind-nullable.version>0.2.6</jackson-databind-nullable.version>
1919

2020
<spotbugs-annotations.version>4.8.5</spotbugs-annotations.version>
21+
2122
<!--info.version from cdoc2-openapi/cdoc2-key-capsules-openapi.yaml -->
2223
<cdoc2-key-capsules-openapi.version>2.1.0</cdoc2-key-capsules-openapi.version>
23-
<maven.repository.url>gitlab.ext.cyber.ee::::https://gitlab.ext.cyber.ee/api/v4/projects/39/packages/maven</maven.repository.url>
2424
</properties>
2525

26-
<repositories>
27-
<repository>
28-
<id>gitlab.ext.cyber.ee</id>
29-
<url>https://gitlab.ext.cyber.ee/api/v4/projects/39/packages/maven</url>
30-
</repository>
31-
</repositories>
32-
33-
<distributionManagement>
34-
<repository>
35-
<id>gitlab.ext.cyber.ee</id>
36-
<url>https://gitlab.ext.cyber.ee/api/v4/projects/40/packages/maven</url>
37-
</repository>
38-
39-
<snapshotRepository>
40-
<id>gitlab.ext.cyber.ee</id>
41-
<url>https://gitlab.ext.cyber.ee/api/v4/projects/40/packages/maven</url>
42-
</snapshotRepository>
43-
</distributionManagement>
44-
45-
4626
<dependencies>
4727
<dependency>
4828
<groupId>ch.qos.logback</groupId>
@@ -157,8 +137,6 @@
157137
<artifactId>cdoc2-key-capsules-openapi</artifactId>
158138
<version>${cdoc2-key-capsules-openapi.version}</version>
159139
<packaging>yaml</packaging>
160-
<!-- can be removed when copied to cdoc2-java-ref-impl repo -->
161-
<remoteRepositories>${maven.repository.url}</remoteRepositories>
162140
</configuration>
163141
</execution>
164142

pom.xml

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,67 @@
8484
</plugins>
8585
</build>
8686
</profile>
87-
</profiles>
8887

89-
<!-- Configuration for Maven Release plugin -->
90-
<scm>
91-
<connection>scm:git:${project.scm.url}</connection>
92-
<developerConnection>scm:git:${project.scm.url}</developerConnection>
93-
<url>[email protected]:jann0k/cdoc2-java-ref-impl-private.git</url>
94-
<tag>HEAD</tag>
95-
</scm>
88+
<profile>
89+
<!-- activate github profile when runned by github actions -->
90+
<id>github</id>
91+
<activation>
92+
<property>
93+
<name>env.GITHUB_ACTIONS</name>
94+
<value>true</value>
95+
</property>
96+
</activation>
97+
<repositories>
98+
<repository>
99+
<id>github</id>
100+
<url>https://maven.pkg.github.com/open-eid/cdoc2-capsule-server</url>
101+
</repository>
102+
</repositories>
103+
</profile>
104+
105+
<!--profile>
106+
<id>gitlab.ext</id>
107+
<repositories>
108+
<repository>
109+
<id>gitlab.ext.cyber.ee</id>
110+
<url>https://gitlab.ext.cyber.ee/api/v4/projects/39/packages/maven</url>
111+
</repository>
112+
</repositories>
113+
</profile-->
114+
</profiles>
96115

97116
<repositories>
98-
<repository>
117+
<!--repository>
99118
<id>gitlab.ext.cyber.ee</id>
100119
<url>https://gitlab.ext.cyber.ee/api/v4/projects/39/packages/maven</url>
101-
</repository>
120+
</repository-->
121+
<!--repository>
122+
<id>github</id>
123+
<url>https://maven.pkg.github.com/jann0k/cdoc2-java-ref-impl</url>
124+
</repository-->
125+
<!--repository>
126+
<id>github</id>
127+
<url>https://maven.pkg.github.com/open-eid/cdoc2-capsule-server</url>
128+
</repository-->
102129
</repositories>
103130

104-
<distributionManagement>
131+
132+
<!--distributionManagement>
133+
<repository>
134+
<id>github</id>
135+
<name>GitHub jann0k Maven Packages</name>
136+
<url>https://maven.pkg.github.com/jann0k/cdoc2-java-ref-impl</url>
137+
</repository>
138+
139+
<snapshotRepository>
140+
<id>github</id>
141+
<name>GitHub jann0k Maven Packages</name>
142+
<url>https://maven.pkg.github.com/jann0k/cdoc2-java-ref-impl</url>
143+
</snapshotRepository>
144+
</distributionManagement-->
145+
146+
147+
<!--distributionManagement>
105148
<repository>
106149
<id>gitlab.ext.cyber.ee</id>
107150
<url>https://gitlab.ext.cyber.ee/api/v4/projects/40/packages/maven</url>
@@ -111,7 +154,7 @@
111154
<id>gitlab.ext.cyber.ee</id>
112155
<url>https://gitlab.ext.cyber.ee/api/v4/projects/40/packages/maven</url>
113156
</snapshotRepository>
114-
</distributionManagement>
157+
</distributionManagement-->
115158

116159
<modules>
117160
<module>cdoc2-schema</module>

0 commit comments

Comments
 (0)