Skip to content

Commit

Permalink
Adjusted POM metadata and deployment settings to allow for artifact d…
Browse files Browse the repository at this point in the history
…eployment as GitHub packages.
  • Loading branch information
david-waltermire committed May 27, 2024
1 parent de18cc3 commit 4729a0b
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 93 deletions.
45 changes: 33 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ jobs:
actions: read
contents: read
security-events: write
packages: write
env:
# BUILD_SNAPSHOT: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
# (github.ref_name == 'develop' || startsWith(github.ref_name, 'release-')) }}
BUILD_SNAPSHOT: false
BUILD_SNAPSHOT: true
DEPLOY_MAVEN_CENTRAL: false
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
Expand All @@ -47,11 +49,8 @@ jobs:
java-version: 11
distribution: 'temurin'
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
# gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
# gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Set up JDK 11 (build only)
if: ${{ steps.setup-java-deploy.outcome == 'skipped' }}
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
Expand All @@ -67,17 +66,17 @@ jobs:
# -------------------------
# Maven Build
# -------------------------
- id: build-test-deploy
- id: build-test-deploy-github
name: Build, Test and DEPLOY SNAPSHOT Code
if: ${{ env.BUILD_SNAPSHOT == 'true' }}
run: |
mvn -B -e -Pgpg -Prelease -Preporting deploy -Dmaven.deploy.skip=releases
# mvn -B -e -Pgpg -Prelease -Preporting deploy -Dmaven.deploy.skip=releases
mvn -B -e -Prelease -Preporting deploy -Dmaven.deploy.skip=releases
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Build and Test Code
if: ${{ steps.build-test-deploy.outcome == 'skipped' }}
if: ${{ steps.build-test-deploy-github.outcome == 'skipped' }}
run: |
mvn -B -e -Prelease -Preporting install
- name: Perform CodeQL Analysis
Expand All @@ -89,3 +88,25 @@ jobs:
run: |
# this needs to be run as a second build to ensure source is fully generated by the previous step
mvn -B -e -Prelease -Preporting install site site:stage
- id: setup-java-deploy-maven-central
name: Set up JDK 11 (deploy)
if: ${{ env.BUILD_SNAPSHOT == 'true' && env.DEPLOY_MAVEN_CENTRAL == 'true' }}
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- id: build-test-deploy-maven-central
name: Build, Test and DEPLOY SNAPSHOT Code
if: ${{ env.BUILD_SNAPSHOT == 'true' && env.DEPLOY_MAVEN_CENTRAL == 'true' }}
run: |
mvn -B -e -Pgpg -Prelease -Preporting deploy -Dmaven.deploy.skip=releases
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
17 changes: 13 additions & 4 deletions cli-processor/pom.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-M2-SNAPSHOT</version>
</parent>

<artifactId>cli-processor</artifactId>
<packaging>jar</packaging>

<name>Metaschema CLI Framework</name>
<url>http://maven.apache.org</url>

<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>

<description>Provides command line interface (CLI) functionality used to provide CLI-based tools.</description>

<properties>
<timestamp>${maven.build.timestamp}</timestamp>
Expand All @@ -19,7 +28,7 @@

<dependencies>
<dependency>
<groupId>gov.nist.secauto.metaschema</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>metaschema-core</artifactId>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
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>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-M2-SNAPSHOT</version>
</parent>

Expand All @@ -16,7 +16,7 @@
<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>nist-pages</id>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>
Expand Down
8 changes: 4 additions & 4 deletions databind-metaschema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-M2-SNAPSHOT</version>
</parent>

Expand All @@ -14,7 +14,7 @@
<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>nist-pages</id>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>
Expand Down Expand Up @@ -79,7 +79,7 @@
</pluginManagement>
<plugins>
<plugin>
<groupId>gov.nist.secauto.metaschema</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>metaschema-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
Expand Down
6 changes: 3 additions & 3 deletions databind/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-M2-SNAPSHOT</version>
</parent>

Expand All @@ -17,7 +17,7 @@
<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>nist-pages</id>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>
Expand Down
6 changes: 3 additions & 3 deletions metaschema-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-M2-SNAPSHOT</version>
</parent>

Expand All @@ -14,7 +14,7 @@
<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>nist-pages</id>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>
Expand Down
6 changes: 3 additions & 3 deletions metaschema-documentation-generator/pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>metaschema-documentation-generator</artifactId>
Expand All @@ -12,7 +12,7 @@
<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>nist-pages</id>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>
Expand Down
6 changes: 3 additions & 3 deletions metaschema-freemarker-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

Expand All @@ -16,7 +16,7 @@
<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>nist-pages</id>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>
Expand Down
6 changes: 3 additions & 3 deletions metaschema-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
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>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-M2-SNAPSHOT</version>
</parent>

Expand All @@ -18,7 +18,7 @@
<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>nist-pages</id>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>
Expand Down
2 changes: 1 addition & 1 deletion metaschema-maven-plugin/src/it/generate-sources/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>gov.nist.secauto.metaschema.it</groupId>
<groupId>@project.groupId@.it</groupId>
<artifactId>generate-sources-test</artifactId>
<version>@project.version@</version>

Expand Down
7 changes: 3 additions & 4 deletions metaschema-testing/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>gov.nist.secauto.metaschema</groupId>
<artifactId>metaschema-framework</artifactId>
<groupId>dev.metaschema</groupId>
<artifactId>metaschema-java-parent</artifactId>
<version>1.0.0-M2-SNAPSHOT</version>
</parent>
<artifactId>metaschema-testing</artifactId>
<name>Metaschema Unit Testing Support</name>


<url>${site.url}${project.artifactId}/</url>
<distributionManagement>
<site>
<id>nist-pages</id>
<id>website</id>
<url>${site.url}${project.artifactId}/</url>
</site>
</distributionManagement>
Expand Down
Loading

0 comments on commit 4729a0b

Please sign in to comment.