Skip to content

Commit

Permalink
🎉 Initialize repository
Browse files Browse the repository at this point in the history
  • Loading branch information
lengors committed Aug 15, 2024
0 parents commit 87e6467
Show file tree
Hide file tree
Showing 27 changed files with 1,625 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Default code owners

* @lengors
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
patreon: lengors
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Bug report
description: Report a bug
labels:
- bug
body:
- type: markdown
attributes:
value: ⚠️ Make sure to search for existing issues, discussions or pull requests before creating a new issue.
- type: textarea
attributes:
label: Current behavior
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Steps to reproduce the behavior.
validations:
required: true
- type: textarea
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
validations:
required: false
- type: textarea
attributes:
label: Related issues, discussions or pull requests
description: Link to related issues, discussions or pull requests.
validations:
required: false
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
blank_issues_enabled: false
contact_links:
- name: General
url: https://github.com/lengors/java-template/discussions/new?category=general
about: Chat about anything and everything here
- name: Ideas
url: https://github.com/lengors/java-template/discussions/new?category=ideas
about: Share ideas for new features
- name: Questions
url: https://github.com/lengors/java-template/discussions/new?category=q-a
about: Ask the community for help
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/create_task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Create task
description: Create a task
body:
- type: markdown
attributes:
value: ⚠️ Make sure to search for existing issues, discussions or pull requests before creating a new issue.
- type: textarea
attributes:
label: Description
description: A clear and concise description of what the chore is.
validations:
required: true
- type: textarea
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context about the chore here.
validations:
required: false
- type: textarea
attributes:
label: Related issues, discussions or pull requests
description: Link to related issues, discussions or pull requests.
validations:
required: false
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Feature request
description: Request a new feature
labels:
- enhancement
body:
- type: markdown
attributes:
value: ⚠️ Make sure to search for existing issues, discussions or pull requests before creating a new issue.
- type: textarea
attributes:
label: Description
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Proposed solution
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Alternatives considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem or suggestion.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
validations:
required: false
- type: textarea
attributes:
label: Related issues, discussions or pull requests
description: Link to related issues, discussions or pull requests.
validations:
required: false
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
Thank you for your contribution to the Maven Java Template! We appreciate your efforts.
Before submitting your pull request, please ensure you've covered the following:
1. **Branching**: Create your branch from a fork of the repository and base it on the `dev` branch.
2. **PR Title**:
- Use the default title: "🔀 Merge `origin/<source_branch>` into `origin/<target_branch:usually dev>`".
- If your PR addresses an issue, link the issue number in the `Development` section of the PR body.
- If your PR does not address an issue, include a brief description in the PR body detailing the purpose and scope of the changes.
3. **Testing**: Run `./mvnw clean test` to ensure all tests pass.
4. **Code Style**: Check your code with [Checkstyle](https://checkstyle.org) (`./mvnw checkstyle:check`).
When merging the PR, please use the default title, and include the issue reference `#issue_number` in parentheses after the title if applicable and missing.
For more details on contributing, please refer to our guide: https://github.com/lengors/maven-java-template/blob/main/CONTRIBUTING.md
-->
61 changes: 61 additions & 0 deletions .github/workflows/publish-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: Publish package to maven central

on:
push:
branches:
- main
- beta
- alpha
- dev

jobs:
deploy-and-publish:
name: Deploy and publish package
runs-on: ubuntu-latest
environment: deployment
steps:
- name: Create GitHub app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: temurin
cache: maven
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Publish package
id: semantic
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/exec
semantic-release-gitmoji
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
38 changes: 38 additions & 0 deletions .github/workflows/static-code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Static code analysis

on:
push:
branches:
- main
- beta
- alpha
- dev
pull_request:
branches:
- main
- beta
- alpha
- dev

jobs:
code-analysis:
name: Static code analysis
environment: code-analysis
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: maven
- name: Perform static code analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dgpg.skip -Dsonar.projectKey=lengors_maven-java-template
51 changes: 51 additions & 0 deletions .github/workflows/validate-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Validate pull request

on:
pull_request:
branches:
- main
- beta
- alpha
- dev

jobs:
check-style:
name: Check code style
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: temurin
cache: maven
- name: Perform style check
run: ./mvnw checkstyle:check

build-and-test:
name: Build and test project
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
distribution:
- temurin
- zulu
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: ${{ matrix.distribution }}
cache: maven
- name: Perform build and tests
run: ./mvnw clean package

65 changes: 65 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Build files
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
.idea/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
Loading

0 comments on commit 87e6467

Please sign in to comment.