Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit b017431

Browse files
authored
Merge pull request #51 from admin-shell-io/feature/deploy-to-sonatype
Feature/deploy to sonatype
2 parents dfecd73 + 8457fe3 commit b017431

3 files changed

Lines changed: 128 additions & 7 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will deploy the Serializers and the Validator to the sonatype
2+
# staging environment. This will NOT automatically publish the artifacts. An
3+
# authorized user must still manually close the staging repository first.
4+
5+
name: Generate and Deploy to Sonatype
6+
7+
on:
8+
push:
9+
branches: [ main ]
10+
11+
jobs:
12+
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up JDK 1.8
19+
uses: actions/setup-java@v2
20+
with:
21+
java-version: 11
22+
distribution: 'adopt'
23+
server-id: ossrh
24+
server-username: OSSRH_USERNAME
25+
server-password: OSSRH_PASSWORD
26+
gpg-private-key: ${{ secrets.MYGPGKEY_SEC }}
27+
28+
- name: Publish to Apache Maven Central
29+
run: mvn -P MavenCentral license:format deploy
30+
env:
31+
OSSRH_USERNAME: sebbader
32+
OSSRH_PASSWORD: ${{ secrets.SEBBADER_OSSHR_PASSWORD }}
33+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSWORD }}
34+
GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSWORD }}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a PR is accepted/new content is pushed
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3+
4+
name: Maven Publish Snapshot
5+
6+
on:
7+
push:
8+
branches:
9+
- development
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up JDK 11
22+
uses: actions/setup-java@v2
23+
with:
24+
java-version: '11'
25+
distribution: 'adopt'
26+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
27+
settings-path: ${{ github.workspace }} # location for the settings.xml file
28+
29+
- name: Build with Maven
30+
run: mvn -B package --file pom.xml
31+
32+
- name: Delete old dataformat-parent package
33+
uses: actions/delete-package-versions@v1
34+
continue-on-error: true
35+
with:
36+
package-name: 'io.admin-shell.aas.dataformat-parent'
37+
38+
- name: Delete old dataformat-core package
39+
uses: actions/delete-package-versions@v1
40+
continue-on-error: true
41+
with:
42+
package-name: 'io.admin-shell.aas.dataformat-core'
43+
44+
- name: Delete old dataformat-aasx package
45+
uses: actions/delete-package-versions@v1
46+
continue-on-error: true
47+
with:
48+
package-name: 'io.admin-shell.aas.dataformat-aasx'
49+
50+
- name: Delete old dataformat-xml package
51+
uses: actions/delete-package-versions@v1
52+
continue-on-error: true
53+
with:
54+
package-name: 'io.admin-shell.aas.dataformat-xml'
55+
56+
- name: Delete old dataformat-aml package
57+
uses: actions/delete-package-versions@v1
58+
continue-on-error: true
59+
with:
60+
package-name: 'io.admin-shell.aas.dataformat-aml'
61+
62+
- name: Delete old dataformat-rdf package
63+
uses: actions/delete-package-versions@v1
64+
continue-on-error: true
65+
with:
66+
package-name: 'io.admin-shell.aas.dataformat-rdf'
67+
68+
- name: Delete old dataformat-json package
69+
uses: actions/delete-package-versions@v1
70+
continue-on-error: true
71+
with:
72+
package-name: 'io.admin-shell.aas.dataformat-json'
73+
74+
- name: Delete old validator package
75+
uses: actions/delete-package-versions@v1
76+
continue-on-error: true
77+
with:
78+
package-name: 'io.admin-shell.aas.validator'
79+
80+
- name: Publish to GitHub Packages Apache Maven
81+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
82+
env:
83+
GITHUB_TOKEN: ${{ github.token }}

pom.xml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<module>validator</module>
4141
</modules>
4242
<properties>
43-
<revision>1.1.0</revision>
44-
<model.version>${revision}</model.version>
43+
<revision>1.3.0-SNAPSHOT</revision>
44+
<model.version>1.1.1</model.version>
4545

4646
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4747
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -187,10 +187,6 @@
187187
<groupId>org.apache.maven.plugins</groupId>
188188
<artifactId>maven-gpg-plugin</artifactId>
189189
<version>${plugin.gpg.version}</version>
190-
<configuration>
191-
<keyname>${gpg.keyname}</keyname>
192-
<passphraseServerId>${gpg.keyname}</passphraseServerId>
193-
</configuration>
194190
<executions>
195191
<execution>
196192
<id>sign-artifacts</id>
@@ -203,7 +199,7 @@
203199
</plugin>
204200
</plugins>
205201
</build>
206-
202+
207203
<!-- Central Repository deployment configuration -->
208204
<distributionManagement>
209205
<snapshotRepository>
@@ -247,6 +243,14 @@
247243
</dependencies>
248244
</dependencyManagement>
249245

246+
<distributionManagement>
247+
<repository>
248+
<id>github</id>
249+
<name>GitHub Apache Maven Packages</name>
250+
<url>https://maven.pkg.github.com/${env.GITHUB_REPOSITORY}</url>
251+
</repository>
252+
</distributionManagement>
253+
250254
<licenses>
251255
<license>
252256
<name>Apache License, Version 2.0</name>

0 commit comments

Comments
 (0)