Skip to content
Merged
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
44 changes: 44 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Kotlin files
[*.{kt,kts}]
indent_style = space
indent_size = 4
max_line_length = 120
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true

# XML files (Maven POM)
[*.xml]
indent_style = space
indent_size = 4

# YAML files (GitHub Actions, etc.)
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# Markdown files
[*.md]
trim_trailing_whitespace = false
max_line_length = off

# JSON files
[*.json]
indent_style = space
indent_size = 2

# Properties files
[*.properties]
indent_style = space
indent_size = 4
31 changes: 31 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# .gitattributes - Ensures consistent line endings
* text=auto

# Kotlin files
*.kt text eol=lf
*.kts text eol=lf

# Configuration files
*.xml text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.json text eol=lf
*.properties text eol=lf
*.md text eol=lf

# Shell scripts
*.sh text eol=lf
mvnw text eol=lf

# Windows scripts
*.bat text eol=crlf
*.cmd text eol=crlf
mvnw.cmd text eol=crlf

# Binary files
*.jar binary
*.jks binary
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---

## Bug Description
A clear and concise description of what the bug is.

## To Reproduce
Steps to reproduce the behavior:
1. Create a server with '...'
2. Make a request to '...'
3. See error

## Expected Behavior
A clear and concise description of what you expected to happen.

## Actual Behavior
What actually happened.

## Code Sample
```kotlin
// Minimal code to reproduce the issue
val server = Server()
// ...
```

## Environment
- Kottpd version: [e.g., 0.2.2]
- Kotlin version: [e.g., 1.9.23]
- JDK version: [e.g., 11, 17, 21]
- OS: [e.g., Ubuntu 22.04, macOS 14, Windows 11]

## Stack Trace
If applicable, paste the full stack trace here:
```
```

## Additional Context
Add any other context about the problem here.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

## Feature Description
A clear and concise description of the feature you'd like to see.

## Problem/Use Case
Describe the problem this feature would solve or the use case it addresses.
Example: "I'm always frustrated when..."

## Proposed Solution
Describe how you envision this feature working.

## Code Example
If applicable, provide a code example of how this feature would be used:
```kotlin
server.newFeature("/example") { req, res ->
// Your idea here
}
```

## Alternatives Considered
Describe any alternative solutions or features you've considered.

## Additional Context
- Would this be a breaking change? Yes/No
- Priority: Low/Medium/High
- Any other context, screenshots, or examples

## Related Issues/PRs
Link any related issues or pull requests.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Question
about: Ask a question about using Kottpd
title: '[QUESTION] '
labels: question
assignees: ''
---

## Question
Ask your question here.

## Context
Provide any relevant context or what you're trying to achieve.

## What I've Tried
Describe what you've already attempted.

## Code Sample (if applicable)
```kotlin
// Your code here
```

## Additional Information
Any other information that might be helpful.

---

**Note:** For general discussions, consider using [GitHub Discussions](https://github.com/gimlet2/kottpd/discussions) instead of opening an issue.
51 changes: 51 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Description
<!-- Provide a brief description of the changes in this PR -->

## Type of Change
<!-- Mark the relevant option with an "x" -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test improvement

## Related Issue
<!-- Link to the issue this PR addresses, if applicable -->
Closes #

## Changes Made
<!-- List the main changes made in this PR -->

-
-
-

## Testing
<!-- Describe the tests you ran to verify your changes -->

- [ ] All existing tests pass
- [ ] Added new tests for changes
- [ ] Tested manually (describe below)

**Manual Testing Details:**


## Checklist
<!-- Mark completed items with an "x" -->

- [ ] My code follows the project's coding standards
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have updated the documentation (if applicable)
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have checked my code and corrected any misspellings
- [ ] I have read the [CONTRIBUTING.md](../CONTRIBUTING.md) guide

## Screenshots (if applicable)
<!-- Add screenshots to help explain your changes -->

## Additional Notes
<!-- Any additional information that reviewers should know -->
33 changes: 25 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
name: Java CI
name: Build

on: [pull_request]
on:
pull_request:
push:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.11
uses: actions/setup-java@v1
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 1.11
java-version: '11'
distribution: 'temurin'
cache: 'maven'

- name: Build with Maven
run: ./mvnw package --file pom.xml --no-transfer-progress
run: ./mvnw clean package --file pom.xml --no-transfer-progress

- name: Run tests
run: ./mvnw test --no-transfer-progress

- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: kottpd-jar
path: target/kottpd-*.jar
retention-days: 7
38 changes: 24 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,64 @@
name: Java CI
name: Release

on:
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/setup-java@v1.4.3
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 1.11
java-version: '11'
distribution: 'temurin'
cache: 'maven'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update version
run: mvn versions:set -DnewVersion=$VERSION --no-transfer-progress
env:
VERSION: ${{ github.event.release.tag_name }}
- name: Commit

- name: Commit version update
run: |
git config --global user.name 'gimlet2'
git config --global user.email 'andrey.chernishov@gmail.com'
git commit -am "Update version"
git commit -am "Update version to $VERSION"
git push origin HEAD:main
env:
VERSION: ${{ github.event.release.tag_name }}

- name: Setup GPG
run: echo "$GPG_KEY" | gpg --import --batch --yes
env:
GPG_KEY: ${{ secrets.GPG_KEY }}

- name: Build with Maven
run: ./mvnw package site:jar source:jar --file pom.xml --no-transfer-progress
- name: Publish to Github
run: ./mvnw -X deploy -Pgithub -Dgpg.keyname=$GPG_KEY_ID -Dgpg.passphrase=$GPG_KEY_PASS --no-transfer-progress
run: ./mvnw clean package site:jar source:jar --file pom.xml --no-transfer-progress

- name: Publish to Github Packages
run: ./mvnw -X deploy -Pgithub -Dgpg.keyname=$GPG_KEY_ID -Dgpg.passphrase=$GPG_KEY_PASS --no-transfer-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_KEY_PASS: ${{ secrets.GPG_KEY_PASS }}

- name: Set up Maven Central Repository
uses: actions/setup-java@v1.4.3
uses: actions/setup-java@v4
with:
java-version: 1.11
java-version: '11'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Publish to OSS
- name: Publish to Maven Central
run: ./mvnw -B package site:jar source:jar deploy -Poss-sonatype -Dgpg.keyname=$GPG_KEY_ID -Dgpg.passphrase=$GPG_KEY_PASS --no-transfer-progress
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand Down
Loading