Skip to content

Commit

Permalink
Publish to GitHub Maven registry
Browse files Browse the repository at this point in the history
A new job has been added to build JSS with Maven and publish
the artifacts to GitHub Maven registry. Currently the native
and symkey modules have to be disabled due to a build issue.
The group ID and artifact ID have been renamed to follow the
more commonly used pattern.
  • Loading branch information
edewata committed Apr 19, 2023
1 parent 45dbc15 commit a887db7
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
jar tvf ~/build/jss/jss.jar | awk '{print $8;}' | sort \
| grep -v '/$' \
| tee cmake.out
jar tvf base/target/jss-5.4.0-SNAPSHOT.jar | awk '{print $8;}' | sort \
jar tvf base/target/jss-base-5.4.0-SNAPSHOT.jar | awk '{print $8;}' | sort \
| grep -v '/$' \
| grep -v '^META-INF/maven/' \
| tee maven.out
Expand Down
49 changes: 43 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,59 @@ jobs:
secrets: inherit
if: vars.REGISTRY != ''

build:
name: Waiting for build
publish-maven:
name: Publishing Maven artifacts
needs: init
runs-on: ubuntu-latest
steps:
- name: Wait for build
- name: Clone repository
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Check settings.xml
run: |
cat ~/.m2/settings.xml
- name: Update pom.xml
run: |
sed -i \
-e "s/OWNER/$NAMESPACE/g" \
-e "s/REPOSITORY/jss/g" \
pom.xml
cat pom.xml
- name: Publish Maven artifacts
run: |
# TODO: Fix build issue in native and symkey modules.
mvn \
--batch-mode \
--update-snapshots \
-pl '!native,!symkey' \
deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

wait-for-images:
name: Waiting for container images
needs: init
runs-on: ubuntu-latest
steps:
- name: Wait for container images
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Building JSS'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30

publish:
name: Publishing JSS
needs: [init, build]
publish-images:
name: Publishing container images
needs: [init, wait-for-images]
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Container Registry
Expand Down
4 changes: 2 additions & 2 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.dogtagpki</groupId>
<groupId>org.dogtagpki.jss</groupId>
<artifactId>jss-parent</artifactId>
<version>${revision}</version>
</parent>

<artifactId>jss</artifactId>
<artifactId>jss-base</artifactId>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.dogtagpki</groupId>
<groupId>org.dogtagpki.jss</groupId>
<artifactId>jss-parent</artifactId>
<version>${revision}</version>
</parent>
Expand All @@ -17,7 +17,7 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jss</artifactId>
<artifactId>jss-base</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.dogtagpki</groupId>
<groupId>org.dogtagpki.jss</groupId>
<artifactId>jss-parent</artifactId>
<version>${revision}</version>
</parent>
Expand All @@ -18,7 +18,7 @@

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jss</artifactId>
<artifactId>jss-base</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
32 changes: 25 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>org.dogtagpki</groupId>
<groupId>org.dogtagpki.jss</groupId>
<artifactId>jss-parent</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
Expand All @@ -19,6 +19,13 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<modules>
<module>base</module>
<module>native</module>
<module>symkey</module>
<module>examples</module>
</modules>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -49,11 +56,22 @@
</plugins>
</build>

<modules>
<module>base</module>
<module>native</module>
<module>symkey</module>
<module>examples</module>
</modules>
<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/OWNER/*</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/OWNER/REPOSITORY</url>
</repository>
</distributionManagement>

</project>
4 changes: 2 additions & 2 deletions symkey/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.dogtagpki</groupId>
<groupId>org.dogtagpki.jss</groupId>
<artifactId>jss-parent</artifactId>
<version>${revision}</version>
</parent>
Expand All @@ -18,7 +18,7 @@

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jss</artifactId>
<artifactId>jss-base</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down

0 comments on commit a887db7

Please sign in to comment.