Skip to content

Commit b3fa963

Browse files
authored
Merge pull request #2 from vgerbot-libraries/feature/schema-gen
Feature/schema gen
2 parents 19677dd + 88dacc5 commit b3fa963

32 files changed

Lines changed: 5576 additions & 197 deletions

.github/RELEASE_SETUP.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Maven Central Release Setup
2+
3+
This document describes how to configure GitHub Actions to automatically publish releases to Maven Central.
4+
5+
## Prerequisites
6+
7+
1. A Maven Central account (via [central.sonatype.org](https://central.sonatype.org))
8+
2. A GPG key pair for signing artifacts
9+
10+
## Required GitHub Secrets
11+
12+
Configure the following secrets in your GitHub repository settings (Settings → Secrets and variables → Actions):
13+
14+
### 1. `MAVEN_CENTRAL_USERNAME`
15+
Your Maven Central username/token username.
16+
17+
For Central Portal (recommended):
18+
- Go to https://central.sonatype.com/account
19+
- Generate a new token
20+
- Use the token username
21+
22+
### 2. `MAVEN_CENTRAL_TOKEN`
23+
Your Maven Central password/token password.
24+
25+
For Central Portal:
26+
- Use the token password from the same token generation step above
27+
28+
### 3. `GPG_PRIVATE_KEY`
29+
Your GPG private key used for signing artifacts.
30+
31+
To export your GPG private key:
32+
```bash
33+
# List your keys
34+
gpg --list-secret-keys --keyid-format=long
35+
36+
# Export the key (replace KEY_ID with your key ID)
37+
gpg --armor --export-secret-keys KEY_ID
38+
```
39+
40+
Copy the entire output including the `-----BEGIN PGP PRIVATE KEY BLOCK-----` and `-----END PGP PRIVATE KEY BLOCK-----` lines.
41+
42+
### 4. `GPG_PASSPHRASE`
43+
The passphrase for your GPG private key.
44+
45+
## Generating a GPG Key (if you don't have one)
46+
47+
```bash
48+
# Generate a new key
49+
gpg --gen-key
50+
51+
# Follow the prompts:
52+
# - Use your real name
53+
# - Use your email
54+
# - Choose a strong passphrase
55+
56+
# List your keys to verify
57+
gpg --list-secret-keys --keyid-format=long
58+
59+
# Upload your public key to a key server
60+
gpg --keyserver keyserver.ubuntu.com --send-keys KEY_ID
61+
gpg --keyserver keys.openpgp.org --send-keys KEY_ID
62+
```
63+
64+
## Triggering a Release
65+
66+
There are two ways to trigger a release:
67+
68+
### 1. Tag-based Release (Recommended)
69+
```bash
70+
# Create and push a version tag
71+
git tag v3.0.0
72+
git push origin v3.0.0
73+
```
74+
75+
The workflow will automatically:
76+
- Build the project
77+
- Sign the artifacts
78+
- Deploy to Maven Central
79+
- Create a GitHub release
80+
81+
### 2. Manual Release
82+
Go to Actions → Release to Maven Central → Run workflow and enter the version number.
83+
84+
## Verifying the Release
85+
86+
1. Check the GitHub Actions workflow run for any errors
87+
2. Verify the artifacts on [Maven Central](https://central.sonatype.com/)
88+
3. Check the [Maven Central Repository](https://repo1.maven.org/maven2/com/vgerbot/propify/) (may take a few hours to sync)
89+
90+
## Troubleshooting
91+
92+
### GPG Signing Issues
93+
- Ensure the GPG key is properly formatted with newlines
94+
- Verify the passphrase is correct
95+
- Check that the key hasn't expired: `gpg --list-keys`
96+
97+
### Maven Central Authentication Issues
98+
- Verify your credentials are correct
99+
- Ensure your token hasn't expired
100+
- Check that you have the necessary permissions for the groupId `com.vgerbot`
101+
102+
### Deployment Failures
103+
- Review the GitHub Actions logs
104+
- Ensure all required metadata is present in the POM (name, description, url, licenses, developers, scm)
105+
- Verify that source and javadoc JARs are being generated
106+
107+
## Maven Central Requirements
108+
109+
To successfully publish to Maven Central, your artifacts must include:
110+
- ✅ Project metadata (name, description, URL) - Already configured
111+
- ✅ License information - Already configured
112+
- ✅ Developer information - Already configured
113+
- ✅ SCM information - Already configured
114+
- ✅ Source JAR - Configured via maven-source-plugin
115+
- ✅ Javadoc JAR - Configured via maven-javadoc-plugin
116+
- ✅ GPG signatures - Configured via maven-gpg-plugin in release profile
117+
118+
All requirements are already satisfied in your `propify/pom.xml`.

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release to Maven Central
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Release version'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up JDK 8
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '8'
28+
distribution: 'temurin'
29+
cache: maven
30+
server-id: oss
31+
server-username: MAVEN_USERNAME
32+
server-password: MAVEN_PASSWORD
33+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
34+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
35+
36+
- name: Configure Git
37+
run: |
38+
git config user.name "${{ github.actor }}"
39+
git config user.email "${{ github.actor }}@users.noreply.github.com"
40+
41+
- name: Build and Deploy to Maven Central
42+
run: |
43+
mvn -B clean deploy -P release
44+
env:
45+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
46+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
47+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
48+
49+
- name: Create GitHub Release
50+
uses: softprops/action-gh-release@v1
51+
if: startsWith(github.ref, 'refs/tags/')
52+
with:
53+
generate_release_notes: true
54+
files: |
55+
propify/target/*.jar
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Contributing to Propify
2+
3+
Thank you for your interest in contributing to Propify! We welcome contributions from the community.
4+
5+
## How to Contribute
6+
7+
### Reporting Issues
8+
9+
If you find a bug or have a feature request:
10+
11+
1. Check if the issue already exists in the [issue tracker](https://github.com/vgerbot-libraries/propify/issues)
12+
2. If not, create a new issue with a clear title and description
13+
3. Include relevant details:
14+
- Steps to reproduce (for bugs)
15+
- Expected vs actual behavior
16+
- Your environment (Java version, build tool, OS)
17+
- Code samples or stack traces if applicable
18+
19+
### Submitting Pull Requests
20+
21+
1. **Fork the repository** and create your branch from `main`:
22+
```bash
23+
git checkout -b feature/your-feature-name
24+
```
25+
26+
2. **Make your changes**:
27+
- Write clean, readable code
28+
- Follow the existing code style
29+
- Add tests for new features
30+
- Update documentation as needed
31+
32+
3. **Test your changes**:
33+
```bash
34+
mvn clean test
35+
```
36+
37+
4. **Commit your changes**:
38+
- Use clear, descriptive commit messages
39+
- Reference issue numbers if applicable (e.g., "Fix #123: Description")
40+
41+
5. **Push to your fork**:
42+
```bash
43+
git push origin feature/your-feature-name
44+
```
45+
46+
6. **Open a Pull Request**:
47+
- Provide a clear description of the changes
48+
- Link to any related issues
49+
- Ensure CI builds pass
50+
51+
## Development Setup
52+
53+
### Prerequisites
54+
55+
- Java 8 or higher
56+
- Maven 3.6+
57+
- Git
58+
59+
### Building from Source
60+
61+
```bash
62+
# Clone the repository
63+
git clone https://github.com/vgerbot-libraries/propify.git
64+
cd propify
65+
66+
# Build the project
67+
mvn clean install
68+
69+
# Run tests
70+
mvn test
71+
72+
# Run examples
73+
cd example
74+
mvn clean compile exec:java
75+
```
76+
77+
## Code Style
78+
79+
- Follow standard Java conventions
80+
- Use meaningful variable and method names
81+
- Add Javadoc comments for public APIs
82+
- Keep methods focused and concise
83+
- Write tests for new functionality
84+
85+
## Testing
86+
87+
- Write unit tests for all new features
88+
- Ensure all tests pass before submitting PR
89+
- Aim for good test coverage
90+
- Include both positive and negative test cases
91+
92+
## Documentation
93+
94+
- Update relevant documentation in `docs/` for feature changes
95+
- Update README.md if adding major features
96+
- Add examples to `example/` for new functionality
97+
- Include Javadoc for public APIs
98+
99+
## Questions?
100+
101+
If you have questions about contributing, feel free to:
102+
103+
- Open a discussion in the [issue tracker](https://github.com/vgerbot-libraries/propify/issues)
104+
- Check existing documentation in the `docs/` folder
105+
106+
## License
107+
108+
By contributing to Propify, you agree that your contributions will be licensed under the MIT License.
109+
110+
Thank you for contributing! 🎉

0 commit comments

Comments
 (0)