Skip to content

Commit 1d2c8b6

Browse files
committed
feat: initial commit
0 parents  commit 1d2c8b6

37 files changed

+2589
-0
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Bug Report
2+
description: Report an Issue or Bug with the Package
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
10+
- type: textarea
11+
id: what-happened
12+
attributes:
13+
label: What happened?
14+
description: What did you expect to happen?
15+
placeholder: I cannot currently do X thing because when I do, it breaks X thing.
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: how-to-reproduce
20+
attributes:
21+
label: How to reproduce the bug
22+
description: How did this occur, please add any config values used and provide a set of reliable steps if possible.
23+
placeholder: When I do X I see Y.
24+
validations:
25+
required: true
26+
- type: input
27+
id: package-version
28+
attributes:
29+
label: Package Version
30+
description: What version of our Package are you running? Please be as specific as possible
31+
placeholder: 2.0.0
32+
validations:
33+
required: true
34+
- type: input
35+
id: java-version
36+
attributes:
37+
label: Java Version
38+
description: What version of Java are you running? Please be as specific as possible
39+
placeholder: 17.0.1
40+
validations:
41+
required: true
42+
- type: dropdown
43+
id: operating-systems
44+
attributes:
45+
label: Which operating systems does this happen with?
46+
description: You may select more than one.
47+
multiple: true
48+
options:
49+
- macOS
50+
- Windows
51+
- Linux
52+
- type: textarea
53+
id: notes
54+
attributes:
55+
label: Notes
56+
description: Use this field to provide any other notes that you feel might be relevant to the issue.
57+
validations:
58+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/lettermint/lettermint-java/discussions/new?category=q-a
5+
about: Ask the community for help
6+
- name: Request a feature
7+
url: https://github.com/lettermint/lettermint-java/discussions/new?category=ideas
8+
about: Share ideas for new features
9+
- name: Report a security issue
10+
url: https://github.com/lettermint/lettermint-java/security/policy
11+
about: Learn how to notify us for sensitive bugs

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gradle"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 10
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
test:
13+
name: Test (Java ${{ matrix.java }} - ${{ matrix.os }})
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 10
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
os: [ubuntu-latest, windows-latest]
20+
java: [8, 11, 17, 21]
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v6
25+
26+
- name: Set up JDK ${{ matrix.java }}
27+
uses: actions/setup-java@v5
28+
with:
29+
java-version: ${{ matrix.java }}
30+
distribution: 'temurin'
31+
cache: 'gradle'
32+
33+
- name: Grant execute permission for gradlew
34+
run: chmod +x gradlew
35+
if: runner.os != 'Windows'
36+
37+
- name: Build with Gradle
38+
run: ./gradlew build --no-daemon
39+
40+
- name: Run tests
41+
run: ./gradlew test --no-daemon
42+
43+
- name: Upload test results
44+
uses: actions/upload-artifact@v6
45+
if: failure()
46+
with:
47+
name: test-results-java-${{ matrix.java }}-${{ matrix.os }}
48+
path: build/reports/tests/test/
49+
50+
build:
51+
name: Build
52+
runs-on: ubuntu-latest
53+
needs: test
54+
55+
steps:
56+
- name: Checkout code
57+
uses: actions/checkout@v6
58+
59+
- name: Set up JDK 17
60+
uses: actions/setup-java@v5
61+
with:
62+
java-version: '17'
63+
distribution: 'temurin'
64+
cache: 'gradle'
65+
66+
- name: Grant execute permission for gradlew
67+
run: chmod +x gradlew
68+
69+
- name: Build package
70+
run: ./gradlew build --no-daemon
71+
72+
- name: Check build output
73+
run: |
74+
if [ ! -d "build/libs" ]; then
75+
echo "Build output directory 'build/libs' not found"
76+
exit 1
77+
fi

.github/workflows/code-style.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Check code style
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.java'
7+
- '.github/workflows/code-style.yml'
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
checkstyle:
15+
name: checkstyle
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v6
22+
23+
- name: Set up JDK 17
24+
uses: actions/setup-java@v5
25+
with:
26+
java-version: '17'
27+
distribution: 'temurin'
28+
cache: 'gradle'
29+
30+
- name: Grant execute permission for gradlew
31+
run: chmod +x gradlew
32+
33+
- name: Check code style
34+
run: ./gradlew checkstyleMain checkstyleTest --no-daemon || true
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: dependabot-auto-merge
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
15+
- name: Dependabot metadata
16+
id: metadata
17+
uses: dependabot/fetch-metadata@v2.5.0
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
21+
- name: Auto-merge Dependabot PRs for semver-minor updates
22+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
23+
run: gh pr merge --auto --merge "$PR_URL"
24+
env:
25+
PR_URL: ${{github.event.pull_request.html_url}}
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
28+
- name: Auto-merge Dependabot PRs for semver-patch updates
29+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
30+
run: gh pr merge --auto --merge "$PR_URL"
31+
env:
32+
PR_URL: ${{github.event.pull_request.html_url}}
33+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release to Discord
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
github-releases-to-discord:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v6
14+
- name: Discord Release Webhook
15+
uses: lettermint/action-discord-releases@v1.0.1
16+
with:
17+
color: 'b07219'
18+
webhook_url: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
19+
content: 'A new release for the Lettermint Java SDK is now available! ||@Java||'

.github/workflows/release.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
java: [8, 11, 17, 21]
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v6
23+
24+
- name: Set up JDK ${{ matrix.java }}
25+
uses: actions/setup-java@v5
26+
with:
27+
java-version: ${{ matrix.java }}
28+
distribution: 'temurin'
29+
cache: 'gradle'
30+
31+
- name: Grant execute permission for gradlew
32+
run: chmod +x gradlew
33+
34+
- name: Run tests
35+
run: ./gradlew test --no-daemon
36+
37+
release:
38+
name: Release
39+
runs-on: ubuntu-latest
40+
needs: test
41+
if: github.ref == 'refs/heads/main'
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v6
46+
with:
47+
fetch-depth: 0
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Set up JDK 17
51+
uses: actions/setup-java@v5
52+
with:
53+
java-version: '17'
54+
distribution: 'temurin'
55+
cache: 'gradle'
56+
57+
- name: Setup Node.js
58+
uses: actions/setup-node@v6
59+
with:
60+
node-version: 20
61+
62+
- name: Install semantic-release
63+
run: npm install -g semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/exec
64+
65+
- name: Grant execute permission for gradlew
66+
run: chmod +x gradlew
67+
68+
- name: Configure Git
69+
run: |
70+
git config user.name "github-actions[bot]"
71+
git config user.email "github-actions[bot]@users.noreply.github.com"
72+
73+
- name: Release
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
77+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
78+
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }}
79+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
80+
GPG_PRIVATE_KEY_BASE64: ${{ secrets.GPG_PRIVATE_KEY }}
81+
run: |
82+
export ORG_GRADLE_PROJECT_signingKey=$(echo "$GPG_PRIVATE_KEY_BASE64" | base64 -d)
83+
npx semantic-release

.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Compiled class files
2+
*.class
3+
4+
# Log files
5+
*.log
6+
7+
# Package files
8+
*.jar
9+
*.war
10+
*.nar
11+
*.ear
12+
*.zip
13+
*.tar.gz
14+
*.rar
15+
16+
# Maven
17+
target/
18+
pom.xml.tag
19+
pom.xml.releaseBackup
20+
pom.xml.versionsBackup
21+
pom.xml.next
22+
release.properties
23+
dependency-reduced-pom.xml
24+
buildNumber.properties
25+
.mvn/timing.properties
26+
.mvn/wrapper/maven-wrapper.jar
27+
28+
# Gradle
29+
.gradle/
30+
build/
31+
!gradle/wrapper/gradle-wrapper.jar
32+
33+
# IDE
34+
.idea/
35+
*.iml
36+
*.ipr
37+
*.iws
38+
.project
39+
.classpath
40+
.settings/
41+
.vscode/
42+
*.swp
43+
*~
44+
.claude/
45+
46+
# OS
47+
.DS_Store
48+
Thumbs.db
49+
50+
# Test output
51+
test-output/
52+
53+
# Local sandbox
54+
sandbox/

0 commit comments

Comments
 (0)