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

Commit a1463b4

Browse files
committed
Adds snapshot publishing workflow
Signed-off-by: Frank Schnicke <frank.schnicke@iese.fraunhofer.de>
1 parent 092a584 commit a1463b4

2 files changed

Lines changed: 64 additions & 15 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 Package
33+
uses: actions/delete-package-versions@v1
34+
with:
35+
package-name: 'io.admin-shell.aas.model'
36+
37+
- name: Publish to GitHub Packages Apache Maven
38+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
39+
env:
40+
GITHUB_TOKEN: ${{ github.token }}

pom.xml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<modelVersion>4.0.0</modelVersion>
2828
<groupId>io.admin-shell.aas</groupId>
2929
<artifactId>dataformat-parent</artifactId>
30-
<version>${revision}</version>
30+
<version>1.3.0-SNAPSHOT</version>
3131
<packaging>pom</packaging>
3232
<modules>
3333
<module>dataformat-aasx</module>
@@ -41,7 +41,7 @@
4141
</modules>
4242
<properties>
4343
<revision>1.1.0</revision>
44-
<model.version>${revision}</model.version>
44+
<model.version>1.3.0-SNAPSHOT</model.version>
4545

4646
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4747
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -180,7 +180,20 @@
180180
<!-- This profile is for the continuous integration pipeline for deploying to the central repository, which requires artifacts to be signed -->
181181
<profiles>
182182
<profile>
183-
<id>CI</id>
183+
<id>deploy_maven_central</id>
184+
185+
<!-- Central Repository deployment configuration -->
186+
<distributionManagement>
187+
<snapshotRepository>
188+
<id>ossrh</id>
189+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
190+
</snapshotRepository>
191+
<repository>
192+
<id>ossrh</id>
193+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
194+
</repository>
195+
</distributionManagement>
196+
184197
<build>
185198
<plugins>
186199
<plugin>
@@ -235,18 +248,14 @@
235248
</dependencies>
236249
</dependencyManagement>
237250

238-
<!-- Central Repository deployment configuration -->
239-
<distributionManagement>
240-
<snapshotRepository>
241-
<id>ossrh</id>
242-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
243-
</snapshotRepository>
244-
<repository>
245-
<id>ossrh</id>
246-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
247-
</repository>
248-
</distributionManagement>
249-
251+
<distributionManagement>
252+
<repository>
253+
<id>github</id>
254+
<name>GitHub Apache Maven Packages</name>
255+
<url>https://maven.pkg.github.com/frankschnicke/java-serializer</url>
256+
</repository>
257+
</distributionManagement>
258+
250259
<licenses>
251260
<license>
252261
<name>Apache License, Version 2.0</name>

0 commit comments

Comments
 (0)