Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Publish to GitHub Packages
name: Publish to GitHub Packages and Maven Central

on:
push:
branches:
- main
release:
types: [created]

jobs:
build:
Expand All @@ -26,3 +28,28 @@ jobs:
run: mvn deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-to-maven-central:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Build with Maven
run: mvn clean install

- name: Publish to Maven Central
run: mvn deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nengen
The 4th iteration of virtual cardboard's Java game engine. This LWJGL-based engine is an organized yet flexible alternative to LibGDX.

## Automatic Deployment to GitHub Packages
## Automatic Deployment to GitHub Packages and Maven Central

This project is configured to automatically deploy to GitHub Packages using GitHub Actions on each commit to the `main` branch. No manual deployment steps are required.
This project is configured to automatically deploy to GitHub Packages and Maven Central using GitHub Actions on each commit to the `main` branch. No manual deployment steps are required.
31 changes: 31 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,29 @@
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<repositoryId>ossrh</repositoryId>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</configuration>
</plugin>
</plugins>
</build>

Expand All @@ -232,6 +255,14 @@
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/virtual-cardboard/nengen</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

</project>
5 changes: 5 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
<server>
<id>ossrh</id>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_PASSWORD}</password>
</server>
</servers>
</settings>
Loading